Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Unified Diff: third_party/sqlite/src/test/check.test

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/cffault.test ('k') | third_party/sqlite/src/test/close.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/check.test
diff --git a/third_party/sqlite/src/test/check.test b/third_party/sqlite/src/test/check.test
index 02b99f2ac9137c18a8507855d083f7393f8da49e..43e447f70d7ad9d5b8c285ccc2681b55fd5b180a 100644
--- a/third_party/sqlite/src/test/check.test
+++ b/third_party/sqlite/src/test/check.test
@@ -459,4 +459,24 @@ do_execsql_test 8.1 {
CREATE TABLE t811(b, CHECK( xyzzy.t811.b BETWEEN 5 AND 10 ));
} {}
+# Make sure check constraints involving the ROWID are not ignored
+#
+do_execsql_test 9.1 {
+ CREATE TABLE t1(
+ a INTEGER PRIMARY KEY,
+ b INTEGER NOT NULL CONSTRAINT 'b-check' CHECK( b>a ),
+ c INTEGER NOT NULL CONSTRAINT 'c-check' CHECK( c>rowid*2 ),
+ d INTEGER NOT NULL CONSTRAINT 'd-check' CHECK( d BETWEEN b AND c )
+ );
+ INSERT INTO t1(a,b,c,d) VALUES(1,2,4,3),(2,4,6,5),(3,10,30,20);
+} {}
+do_catchsql_test 9.2 {
+ UPDATE t1 SET b=0 WHERE a=1;
+} {1 {CHECK constraint failed: b-check}}
+do_catchsql_test 9.3 {
+ UPDATE t1 SET c=a*2 WHERE a=1;
+} {1 {CHECK constraint failed: c-check}}
+
+
+
finish_test
« no previous file with comments | « third_party/sqlite/src/test/cffault.test ('k') | third_party/sqlite/src/test/close.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698