dolt
dolt copied to clipboard
Columns that are named `commit` or `commit_date` appear as NULL in the `dolt_diff_{table_name}` system table.
Repro:
dolt sql -q "CREATE table t (pk int, commit text);"
dolt sql -q "INSERT INTO t VALUES (1, 'hi');"
dolt commit -am "initial"
Table data:
dolt sql -q "SELECT * from t"
+----+--------+
| pk | commit |
+----+--------+
| 1 | hi |
+----+--------+
Diff table:
$ dolt sql -q "SELECT * from dolt_diff_t;"
+-----------+-------+----------------------------------+-----------------------------------+-------------+---------+----------------------------------+-----------------------------------+-----------+
| to_commit | to_pk | to_commit | to_commit_date | from_commit | from_pk | from_commit | from_commit_date | diff_type |
+-----------+-------+----------------------------------+-----------------------------------+-------------+---------+----------------------------------+-----------------------------------+-----------+
| NULL | 1 | 736lsfds067c30freqtve8o0v7lsrmpe | 2022-05-11 20:21:31.744 +0000 UTC | NULL | NULL | 83amk1pnul86ajecveuu4e44ie63c0gp | 2022-05-11 20:20:00.975 +0000 UTC | added |
It seems like we need a better story around how the dolt_diff column names are generated. In the meantime, we can at-least fix the missing data ("hi");
fixed in #3401
Just rediscovering this.
This query shouldn't even pass analysis, because the table schema has two columns with the same name, making it ambiguous. We need to come up with a method to disambiguate user columns when they collide with generated ones.