dolthub / dolthub/dolt

Merge doesn't validate not-null constraints for keyless tables

Open
#7,320 0 comments 0 reactions 1 assignee Claimed by @zachmu View on GitHub
bug good repro merge sql
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 5h
Merged PRs (30d)
108

Description

Repro:
```sql
CREATE TABLE aTable (aColumn INT NULL, bColumn INT NULL);
INSERT INTO aTable VALUES (1, 1);
CALL dolt_commit('-Am', 'add tables');
CALL dolt_checkout('-b', 'side');
INSERT INTO aTable VALUES (2,NULL);
CALL dolt_commit('-am', 'add side data');

CALL dolt_checkout('main');
ALTER TABLE aTable modify column bColumn INT NOT NULL;
CALL dolt_commit('-am', 'add main data');
CALL dolt_checkout('side');
SET @@dolt_force_transaction_commit=1;

-- This should return a response indicating a constraint violation, but instead it creates a new
call dolt_merge('main');

-- Looking at the table data shows the NULLs are in the table, even though the column does have the `NOT NULL ` constraint
select * from aTable;
show create table aTable;
```

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.