sl@0: # 2005 December 19 2005 sl@0: # sl@0: # The author disclaims copyright to this source code. In place of sl@0: # a legal notice, here is a blessing: sl@0: # sl@0: # May you do good and not evil. sl@0: # May you find forgiveness for yourself and forgive others. sl@0: # May you share freely, never taking more than you give. sl@0: # sl@0: #*********************************************************************** sl@0: # This file implements regression tests for SQLite library. sl@0: # sl@0: # This file implements tests to verify that ticket #1567 is sl@0: # fixed. sl@0: # sl@0: sl@0: set testdir [file dirname $argv0] sl@0: source $testdir/tester.tcl sl@0: sl@0: do_test tkt1567-1.1 { sl@0: execsql { sl@0: CREATE TABLE t1(a TEXT PRIMARY KEY); sl@0: } sl@0: set bigstr abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ sl@0: for {set i 0} {$i<100} {incr i} { sl@0: set x [format %5d [expr $i*2]] sl@0: set sql "INSERT INTO t1 VALUES('$x-$bigstr')" sl@0: execsql $sql sl@0: } sl@0: } {} sl@0: integrity_check tkt1567-1.2 sl@0: sl@0: do_test tkt1567-1.3 { sl@0: execsql { sl@0: BEGIN; sl@0: UPDATE t1 SET a = a||'x' WHERE rowid%2==0; sl@0: } sl@0: } {} sl@0: do_test tkt1567-1.4 { sl@0: catchsql { sl@0: UPDATE t1 SET a = CASE WHEN rowid<90 THEN substr(a,1,10) ELSE '9999' END; sl@0: } sl@0: } {1 {column a is not unique}} sl@0: do_test tkt1567-1.5 { sl@0: execsql { sl@0: COMMIT; sl@0: } sl@0: } {} sl@0: integrity_check tkt1567-1.6 sl@0: sl@0: finish_test