-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Details for the issue
- I have a table with a CHECK constraint:
CREATE TABLE Table1
(
id
INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
Date
DATETIME NOT NULL CHECK(Date
IS strftime('%Y-%m-%d', Date
)),
Value
REAL NOT NULL,
Description
TEXT DEFAULT NULL
);
- I have some records in the table:
INSERT INTO Table1 (Date
, Value
, Description
) VALUES ('2017-12-06', 1.0, 'Value1');
INSERT INTO Table1 (Date
, Value
, Description
) VALUES ('2017-12-06', 2.0, 'Value2');
INSERT INTO Table1 (Date
, Value
, Description
) VALUES ('2017-12-06', 3.0, 'Value3');
INSERT INTO Table1 (Date
, Value
, Description
) VALUES ('2017-12-06', 4.0, 'Value4');
INSERT INTO Table1 (Date
, Value
, Description
) VALUES ('2017-12-06', 5.0, 'Value5');
- I select the first row of the table (i.e. the row with
_rowid_
= 1), I right-click on that row and then I apply the "Duplicate record". These are the queries executed by the program:
INSERT INTO main
.Table1
(id
,Date
,Value
) VALUES (6,'','');
UPDATE main
.Table1
SET Value
=? WHERE _rowid_
='5';
UPDATE main
.Table1
SET Description
=? WHERE _rowid_
='5';
The first query (the 'INSERT INTO ...') fails (correct, because the empty field-value for 'Date' does not pass the check) but the program continues. Therefore it updates the wrong record (overwriting an existing record)
Useful extra information
I'm opening this issue because:
- DB4S is crashing
- DB4S has a bug
- DB4S needs a feature
- DB4S has another problem
I'm using DB4S on:
- Windows: ( version: ___ )
- Linux: ( _distro: Ubuntu 16.04 )
- Mac OS: ( version: ___ )
- Other: ___
I'm using DB4S version:
- 3.10.99
- 3.10.0
- 3.9.1
- Other: ___
I have also:
- Tried out the latest nightly version: https://github.com/sqlitebrowser/sqlitebrowser#nightly-builds
- Searched for an existing similar issue: https://github.com/sqlitebrowser/sqlitebrowser/issues?utf8=%E2%9C%93&q=is%3Aissue%20