Merging main into another branch breaks `dolt_diff_<table>`
- Dominant language
- Go
- Stars
- 24.4k
- Forks
- 873
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 108
Description
Repro
```
$ dolt init --fun
Successfully initialized dolt data repository.
$ dolt sql -q "create table xy (x int primary key)"
$ dolt commit -Am "new table"
commit 44oi6heb4fcikr0cffg2bcvnjnn0qh7k (HEAD -> main)
Author: timsehn
Date: Mon Oct 23 11:26:02 -0700 2023
new table
$ dolt branch test
$ dolt branch test2
$ dolt checkout test
Switched to branch 'test'
$ dolt sql -q "insert into xy values (0)"
Query OK, 1 row affected (0.00 sec)
$ dolt commit -am "new val 1"
commit d74pcbhlogrv0uvuck6ta95co2192cdc (HEAD -> test)
Author: timsehn
Date: Mon Oct 23 11:27:03 -0700 2023
new val 1
$ dolt checkout main
Switched to branch 'main'
$ dolt sql -q "call dolt_merge('test', '--no-ff', '-message', 'Merge test into main')"
+----------------------------------+--------------+-----------+
| hash | fast_forward | conflicts |
+----------------------------------+--------------+-----------+
| h221in9dol503a3vu3thqqs9vmiae8d7 | 0 | 0 |
+----------------------------------+--------------+-----------+
$ dolt checkout test2
Switched to branch 'test2'
$ dolt sql -q "call dolt_merge('main', '--no-ff', '-message', 'Merge main into test2')"
+----------------------------------+--------------+-----------+
| hash | fast_forward | conflicts |
+----------------------------------+--------------+-----------+
| o3fvl7ui0ct731sihn9v5a7rnljvocbs | 0 | 0 |
+----------------------------------+--------------+-----------+
$ dolt checkout main
Switched to branch 'main'
$ dolt sql -q "call dolt_merge('test2', '--no-ff', '-message', 'Merge test2 into main')"
+----------------------------------+--------------+-----------+
| hash | fast_forward | conflicts |
+----------------------------------+--------------+-----------+
| deu01jgeaekvov0sp5qln39f9h7ouo9c | 0 | 0 |
+----------------------------------+--------------+-----------+
$ dolt sql -q "select * from dolt_log"
+----------------------------------+-----------+-----------------+---------------------+----------------------------+
| commit_hash | committer | email | date | message |
+----------------------------------+-----------+-----------------+---------------------+----------------------------+
| deu01jgeaekvov0sp5qln39f9h7ouo9c | root | root@localhost | 2023-10-23 18:28:11 | Merge test2 into main |
| o3fvl7ui0ct731sihn9v5a7rnljvocbs | root | root@localhost | 2023-10-23 18:27:41 | Merge main into test2 |
| h221in9dol503a3vu3thqqs9vmiae8d7 | root | root@localhost | 2023-10-23 18:27:22 | Merge test into main |
| d74pcbhlogrv0uvuck6ta95co2192cdc | timsehn | tim@dolthub.com | 2023-10-23 18:27:03 | new val 1 |
| 44oi6heb4fcikr0cffg2bcvnjnn0qh7k | timsehn | tim@dolthub.com | 2023-10-23 18:26:02 | new table |
| d01tqbeee75fti3vthi6k6kkoogsq294 | timsehn | tim@dolthub.com | 2023-10-23 18:25:31 | Initіаlizе datа rеposіtory |
+----------------------------------+-----------+-----------------+---------------------+----------------------------+
$ dolt sql -q "select * from dolt_diff_xy"
+------+----------------------------------+-------------------------+--------+----------------------------------+-------------------------+-----------+
| to_x | to_commit | to_commit_date | from_x | from_commit | from_commit_date | diff_type |
+------+----------------------------------+-------------------------+--------+----------------------------------+-------------------------+-----------+
| 0 | o3fvl7ui0ct731sihn9v5a7rnljvocbs | 2023-10-23 18:27:41.279 | NULL | 44oi6heb4fcikr0cffg2bcvnjnn0qh7k | 2023-10-23 18:26:02.034 | added |
+------+----------------------------------+-------------------------+--------+----------------------------------+-------------------------+-----------+
```
This is the merge commit into test2. The diff should show commit: `d74pcbhlogrv0uvuck6ta95co2192cdc`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.