dolthub / dolthub/dolt

`dolt_diff_<table>` system table incorrectly labels changes as `WORKING` on schema changes

Open
#2,496 3 comments 0 reactions 1 assignee Claimed by @zachmu View on GitHub
bug diff sql system tables
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 5h
Merged PRs (30d)
108

Description

Repro steps:

```sql
test> create database new2;
test> use new2;
Database changed
new2> create table a(a int primary key);
new2> insert into a values (1), (2);
Query OK, 2 rows affected
new2> select dolt_commit('-am', 'first version of table a');
+------------------------------------------------+
| dolt_commit('-am', 'first version of table a') |
+------------------------------------------------+
| ms4rm7l35ml871mfluvmpsj1fgvf9n45 |
+------------------------------------------------+
new2> drop table a;
new2> create table a (x bigint primary key, y varchar(1));
new2> insert into a values (1, 'a'), (0, 'b'), (2, 'c');
Query OK, 3 rows affected
new2> select dolt_commit('-am', 'second version of table a');
+-------------------------------------------------+
| dolt_commit('-am', 'second version of table a') |
+-------------------------------------------------+
| 484g9ao7259kpn3kpsfceeu415ha258k |
+-------------------------------------------------+
new2> select to_x, first_value(to_y) over (partition by to_x), row_number() over (partition by diff_type) from dolt_diff_a;
panic in iterPartitions: runtime error: invalid memory address or nil pointer dereference
```

Needs a bats test.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.