dolt
dolt copied to clipboard
Delete joins throw `table doesn't support DELETE FROM`
CREATE TABLE t (col1 int);
DELETE t
FROM t
JOIN dolt_conflicts_t c ON t.col1 = c.their_col1;
cc: https://github.com/dolthub/dolt/issues/2134
Root cause is #2134
This needs a better repro. We also don't support delete joins on tables with primary keys.
$ dolt init
Successfully initialized dolt data repository.
$ dolt sql -q "create table t1 (pk int, c1 int, primary key(pk)); create table t2 (pk int primary key)"
$ dolt ls
Tables in working set:
t1
t2
$ dolt sql -q "insert into t1 values (0,0), (1,1); insert into t2 values (1);"
Query OK, 2 rows affected (0.00 sec)
Query OK, 1 row affected (0.00 sec)
$ dolt sql -q "delete from t1 join t2 on t1.pk=t2.pk"
Error parsing SQL
syntax error at position 20 near 'join'
delete from t1 join t2 on t1.pk=t2.pk
^
syntax error at position 20 near 'join'
Should just delete (1, 1) in t1
> create table xy (x int primary key, y int);
> delete a from xy a join xy b on a.x = b.x;
table doesn't support DELETE FROM
This spill the right error:
$ dolt sql -q "delete t1 from t1 join t2 on t1.pk=t2.pk"
error on line 1 for query delete t1 from t1 join t2 on t1.pk=t2.pk: table doesn't support DELETE FROM
table doesn't support DELETE FROM
DELETE JOIN support was released yesterday in dolt version 0.54.1