Skip to content

INVISIBLE columns should be ignored in INSERT statement without explicit column list #3983

@lukaseder

Description

@lukaseder

The following statements:

create table t (a int, b int invisible, c int);
insert into t values (1, 2);
select a, b, c from t;

Should produce:

|a  |b  |c  |
|---|---|---|
|1  |   |2  |

But in H2, the INSERT fails with:

SQL Error [21002] [21S02]: Column count does not match; SQL statement:
insert into t values (1, 2) [21002-224]

I don't think that's expected according to the spirit of INVISIBLE fields. I've tried all of these RDBMS which support INVISIBLE or HIDDEN fields, and they all behave like I expected:

  • CockroachDB (NOT VISIBLE)
  • Db2 (IMPLICITLY HIDDEN)
  • HANA (HIDDEN)
  • MariaDB (INVISIBLE)
  • MySQL (INVISIBLE)
  • Oracle (INVISIBLE)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions