Skip to content

inserts with specified fields should error on empty insert values #8193

@jycor

Description

@jycor

MySQL:

mysql> create table t (i int, j int);
Query OK, 0 rows affected (0.0187 sec)
mysql> insert into t(i, j) values ();
ERROR: 1136: Column count doesn't match value count at row 1
mysql> insert into t(j) values ();
ERROR: 1136: Column count doesn't match value count at row 1
mysql> insert into t(i) values ();
ERROR: 1136: Column count doesn't match value count at row 1
mysql> select * from t;
Empty set (0.0029 sec)

Dolt:

tmp/main*> create table t1 (i int, j int);
tmp/main*> insert into t1 values ();
Query OK, 1 row affected (0.00 sec)
tmp/main*> insert into t1(i,j) values ();
Query OK, 1 row affected (0.00 sec)
tmp/main*> insert into t1(j) values ();
Query OK, 1 row affected (0.00 sec)
tmp/main*> insert into t1(i) values ();
Query OK, 1 row affected (0.00 sec)
tmp/main*> select * from t;
+-----+
| i   |
+-----+
| 123 |
+-----+
1 row in set (0.00 sec)

Metadata

Metadata

Assignees

No one assigned

    Labels

    correctnessWe don't return the same result as MySQLgood reproEasily reproducible bugssqlIssue with SQL

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions