Skip to content

Inconsistencies of inserts with default values #7943

@excitoon

Description

@excitoon
:) create table t (a Int DEFAULT 42, b Int DEFAULT 43) engine = MergeTree order by tuple() partition by tuple();

:) insert into t values ()

INSERT INTO t VALUES


Exception on client:
Code: 62. DB::Exception: Cannot parse expression of type Int32 here: )

Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 19.18.1 revision 54429.

:) drop table t

:) create table t (a Int DEFAULT 42) engine = MergeTree order by tuple() partition by tuple();

:) insert into t values ()

INSERT INTO t VALUES

Ok.

1 rows in set. Elapsed: 0.002 sec. 

:) select * from t

SELECT *
FROM t

┌─a─┐
│ 0 │
└───┘

1 rows in set. Elapsed: 0.003 sec. 

I would like to add that documentation for INSERT needs to be actualized after f3b6d35: https://github.com/ClickHouse/ClickHouse/search?q=strict_insert_defaults&type=Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp-formatsInput/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.).not plannedKnown issue, no plans to fix it currenlty

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions