diff options
author | dan <Dan Kennedy> | 2025-05-06 17:56:32 +0000 |
---|---|---|
committer | dan <Dan Kennedy> | 2025-05-06 17:56:32 +0000 |
commit | f67058367b09ebf31dd5aaf199715ba0fd6265fe (patch) | |
tree | 444689b4799dfeba85be14e811a1a8c21adbcd61 /test | |
parent | 288f35685473c82b12bd47610e473ec34524bba7 (diff) | |
download | sqlite-f67058367b09ebf31dd5aaf199715ba0fd6265fe.tar.gz sqlite-f67058367b09ebf31dd5aaf199715ba0fd6265fe.zip |
Add test cases for the NOT NULL/IS NULL optimization in CHECK constraints fix.
FossilOrigin-Name: 6eb2939a6093c0796910645172d80c53055559dd57c012f1dc815d89fbf84447
Diffstat (limited to 'test')
-rw-r--r-- | test/check.test | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/check.test b/test/check.test index 10d1cf4be..c3beb2f5d 100644 --- a/test/check.test +++ b/test/check.test @@ -612,4 +612,36 @@ do_catchsql_test 12.81 { INSERT INTO t1(a) VALUES(456); } {1 {CHECK constraint failed: a NOT BETWEEN +a AND 999999}} +#------------------------------------------------------------------------- + +reset_db + +do_execsql_test 13.1.0 { + CREATE TABLE Table0 (Col0 , CHECK(Table0.Col0 NOT NULL ) ) ; + REPLACE INTO Table0 VALUES (hex(randomblob(100000))); +} +integrity_check 13.1.1 +do_execsql_test 13.1.2 { + UPDATE OR REPLACE Table0 SET Col0 = Table0.Col0 ; +} +integrity_check 13.1.3 +do_execsql_test 13.1.4 { + SELECT length(col0) FROM table0; +} {200000} + +do_execsql_test 13.2.0 { + CREATE TABLE t2 (x , CHECK((NOT (x ISNULL) ))); + REPLACE INTO t2 VALUES (hex(randomblob(100000))); +} +do_execsql_test 13.2.1 { + SELECT length(x) FROM t2 +} {200000} +do_execsql_test 13.2.2 { + UPDATE OR REPLACE t2 SET x = x; +} +do_execsql_test 13.2.3 { + SELECT length(x) FROM t2 +} {200000} +integrity_check 13.2.4 + finish_test |