Skip to content

dolt_status reports a table with constraint violations as modified #3197

Description

@timsehn

Summary

When the working set holds constraint violations, dolt_status reports the table as modified. Dolt reports it as constraint violation.

Repro

PRAGMA foreign_keys=ON;
CREATE TABLE p(id INT PRIMARY KEY);
CREATE TABLE c(id INT PRIMARY KEY, pid INT REFERENCES p(id));
INSERT INTO p VALUES(1),(2);
SELECT dolt_commit('-Am','base');
SELECT dolt_branch('f');
DELETE FROM p WHERE id=2;
SELECT dolt_commit('-am','del p2');
SELECT dolt_checkout('f');
INSERT INTO c VALUES(1,2);
SELECT dolt_commit('-am','child of 2');
SELECT dolt_checkout('main');
BEGIN;
SELECT dolt_merge('f');
SELECT table_name||'|'||status FROM dolt_status;

DoltLite: c|modified. Dolt 2.3.1 (CALL, SET @@autocommit=0): c|constraint violation.

The same row shows up while a rebase is paused on a violation (#3149). src/doltlite_status.c has no constraint violation status at all.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions