databend icon indicating copy to clipboard operation
databend copied to clipboard

Feature: can explicitly use default when inserting data

Open hanyisong opened this issue 3 years ago • 1 comments

Summary version: 8.0.26-v0.7.143-nightly-2476600-simd(rust-1.64.0-nightly-2022-07-26T16:22:42.008143497Z)

mysql> desc t0;
+-------+--------+------+---------+-------+
| Field | Type   | Null | Default | Extra |
+-------+--------+------+---------+-------+
| c0    | DOUBLE | NO   | 0       |       |
| c1    | DOUBLE | NO   | 0       |       |
+-------+--------+------+---------+-------+
2 rows in set (0.01 sec)
Read 0 rows, 0.00 B in 0.008 sec., 0 rows/sec., 0.00 B/sec.

mysql> INSERT INTO t0 VALUES (1541870038,DEFAULT);
ERROR 1105 (HY000): Code: 1006, displayText = Unable to get field named "DEFAULT". Valid fields: ["c0", "c1"].

hanyisong avatar Jul 27 '22 14:07 hanyisong

Please use: INSERT INTO t0(c0) VALUES (1541870038);

bohutang avatar Jul 27 '22 14:07 bohutang