os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/tkt1567.test
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/tkt1567.test	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,51 @@
     1.4 +# 2005 December 19 2005
     1.5 +#
     1.6 +# The author disclaims copyright to this source code.  In place of
     1.7 +# a legal notice, here is a blessing:
     1.8 +#
     1.9 +#    May you do good and not evil.
    1.10 +#    May you find forgiveness for yourself and forgive others.
    1.11 +#    May you share freely, never taking more than you give.
    1.12 +#
    1.13 +#***********************************************************************
    1.14 +# This file implements regression tests for SQLite library.
    1.15 +#
    1.16 +# This file implements tests to verify that ticket #1567 is
    1.17 +# fixed.  
    1.18 +#
    1.19 +
    1.20 +set testdir [file dirname $argv0]
    1.21 +source $testdir/tester.tcl
    1.22 +
    1.23 +do_test tkt1567-1.1 {
    1.24 +  execsql {
    1.25 +    CREATE TABLE t1(a TEXT PRIMARY KEY);
    1.26 +  }
    1.27 +  set bigstr abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
    1.28 +  for {set i 0} {$i<100} {incr i} {
    1.29 +    set x [format %5d [expr $i*2]]
    1.30 +    set sql "INSERT INTO t1 VALUES('$x-$bigstr')"
    1.31 +    execsql $sql
    1.32 +  }
    1.33 +} {}
    1.34 +integrity_check tkt1567-1.2
    1.35 +
    1.36 +do_test tkt1567-1.3 {
    1.37 +  execsql {
    1.38 +    BEGIN;
    1.39 +    UPDATE t1 SET a = a||'x' WHERE rowid%2==0;
    1.40 +  }
    1.41 +} {}
    1.42 +do_test tkt1567-1.4 {
    1.43 +  catchsql {
    1.44 +    UPDATE t1 SET a = CASE WHEN rowid<90 THEN substr(a,1,10) ELSE '9999' END;
    1.45 +  }
    1.46 +} {1 {column a is not unique}}
    1.47 +do_test tkt1567-1.5 {
    1.48 +  execsql {
    1.49 +    COMMIT;
    1.50 +  }
    1.51 +} {}
    1.52 +integrity_check tkt1567-1.6
    1.53 +
    1.54 +finish_test