dolt_commit_diff_<table> doesn't work with subselect
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 73
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 152
Description
Unconfirmed whether this bug is present in Dolt as well.
```sql
CREATE TABLE bug6 (id integer PRIMARY KEY, v text);
INSERT INTO bug6 VALUES (1, 'a');
SELECT dolt_add('-A');
SELECT dolt_commit('--all', '--message', 'base', '--author', 'A ');
UPDATE bug6 SET v = 'b' WHERE id = 1;
SELECT dolt_add('-A');
SELECT dolt_commit('--all', '--message', 'change', '--author', 'A ');
SELECT to_id FROM dolt_commit_diff_bug6
WHERE to_commit = (SELECT commit_hash FROM dolt.log ORDER BY date DESC LIMIT 1)
AND from_commit = (SELECT commit_hash FROM dolt.log ORDER BY date DESC OFFSET 1 LIMIT 1);
ERROR: error querying table dolt_commit_diff_bug6: dolt_commit_diff_* tables must be filtered to a single\
'to_commit'
```
See skipped test in:
https://github.com/dolthub/doltgresql/pull/3104
Contributor guide
Research direction
Start with the SQL reproduction using dolt_commit_diff_bug6 and the skipped test referenced in dolthub/doltgresql#3104. Verify the subselect-based to_commit and from_commit filters, then make the test pass so the query returns the expected diff instead of requiring a literal single to_commit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 67/100