| OLD | NEW |
| 1 # 2005 November 2 | 1 # 2005 November 2 |
| 2 # | 2 # |
| 3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
| 4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
| 5 # | 5 # |
| 6 # May you do good and not evil. | 6 # May you do good and not evil. |
| 7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
| 8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
| 9 # | 9 # |
| 10 #*********************************************************************** | 10 #*********************************************************************** |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 catchsql { INSERT INTO t6 VALUES(12) } db2 | 452 catchsql { INSERT INTO t6 VALUES(12) } db2 |
| 453 } {1 {CHECK constraint failed: t6}} | 453 } {1 {CHECK constraint failed: t6}} |
| 454 | 454 |
| 455 # 2013-08-02: Silently ignore database name qualifiers in CHECK constraints. | 455 # 2013-08-02: Silently ignore database name qualifiers in CHECK constraints. |
| 456 # | 456 # |
| 457 do_execsql_test 8.1 { | 457 do_execsql_test 8.1 { |
| 458 CREATE TABLE t810(a, CHECK( main.t810.a>0 )); | 458 CREATE TABLE t810(a, CHECK( main.t810.a>0 )); |
| 459 CREATE TABLE t811(b, CHECK( xyzzy.t811.b BETWEEN 5 AND 10 )); | 459 CREATE TABLE t811(b, CHECK( xyzzy.t811.b BETWEEN 5 AND 10 )); |
| 460 } {} | 460 } {} |
| 461 | 461 |
| 462 # Make sure check constraints involving the ROWID are not ignored |
| 463 # |
| 464 do_execsql_test 9.1 { |
| 465 CREATE TABLE t1( |
| 466 a INTEGER PRIMARY KEY, |
| 467 b INTEGER NOT NULL CONSTRAINT 'b-check' CHECK( b>a ), |
| 468 c INTEGER NOT NULL CONSTRAINT 'c-check' CHECK( c>rowid*2 ), |
| 469 d INTEGER NOT NULL CONSTRAINT 'd-check' CHECK( d BETWEEN b AND c ) |
| 470 ); |
| 471 INSERT INTO t1(a,b,c,d) VALUES(1,2,4,3),(2,4,6,5),(3,10,30,20); |
| 472 } {} |
| 473 do_catchsql_test 9.2 { |
| 474 UPDATE t1 SET b=0 WHERE a=1; |
| 475 } {1 {CHECK constraint failed: b-check}} |
| 476 do_catchsql_test 9.3 { |
| 477 UPDATE t1 SET c=a*2 WHERE a=1; |
| 478 } {1 {CHECK constraint failed: c-check}} |
| 479 |
| 480 |
| 481 |
| 462 finish_test | 482 finish_test |
| OLD | NEW |