1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-06 08:01:16 +03:00

Fix a corner-case for the logic that cause an insert of a NULL into an

INTEGER PRIMARY KEY column to be converted into a valid integer key,
when the NULL results from a CASE expression that lacks an ELSE clause.

FossilOrigin-Name: 9a425051e7ba59e797636f5cf32b5f6efafdb21c8d5300e099b8008b829c1439
This commit is contained in:
drh
2019-01-17 04:40:04 +00:00
parent 30fdb45da0
commit 04fcef00ee
4 changed files with 22 additions and 17 deletions

View File

@@ -449,6 +449,15 @@ do_execsql_test insert-13.1 {
SELECT * FROM t13 ORDER BY +b;
} {2 0 6 2 1 5}
# 2019-01-17. From the chromium fuzzer.
#
do_execsql_test insert-14.1 {
DROP TABLE IF EXISTS t14;
CREATE TABLE t14(x INTEGER PRIMARY KEY);
INSERT INTO t14 VALUES(CASE WHEN 1 THEN null END);
SELECT x FROM t14;
} {1}
integrity_check insert-99.0
finish_test