SQLite

Check-in [3ceae3579b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add another test case for the "x IS NULL" uniqueness problem of ticket #3824. No changes to code. This just double-checks that everything is working now. (CVS 6548)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3ceae3579bc42974865cf6fe0bc42001e786e894
User & Date: drh 2009-04-24 20:32:31.000
Context
2009-04-25
08:39
Tests for the new asynchronous IO API. (CVS 6549) (check-in: 11b2564e71 user: danielk1977 tags: trunk)
2009-04-24
20:32
Add another test case for the "x IS NULL" uniqueness problem of ticket #3824. No changes to code. This just double-checks that everything is working now. (CVS 6548) (check-in: 3ceae3579b user: drh tags: trunk)
18:06
Dequote the "from" table in a FOREIGN KEY definition (affects the output of "pragma foreign_key_list). Fix for #3800. (CVS 6547) (check-in: 600482d161 user: danielk1977 tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/tkt3824.test.
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#
# Ticket #3824
#
# When you use an "IS NULL" constraint on a UNIQUE index, the result
# is not necessarily UNIQUE.  Make sure the optimizer does not assume
# uniqueness.
#
# $Id: tkt3824.test,v 1.1 2009/04/24 14:51:42 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

proc execsql_status {sql {db db}} {
  set result [uplevel $db eval [list $sql]]
  if {[db status sort]} {







|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#
# Ticket #3824
#
# When you use an "IS NULL" constraint on a UNIQUE index, the result
# is not necessarily UNIQUE.  Make sure the optimizer does not assume
# uniqueness.
#
# $Id: tkt3824.test,v 1.2 2009/04/24 20:32:31 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

proc execsql_status {sql {db db}} {
  set result [uplevel $db eval [list $sql]]
  if {[db status sort]} {
81
82
83
84
85
86
87











88
    INSERT INTO t3 VALUES(234,567);
    CREATE UNIQUE INDEX t3y ON t3(y);
    DELETE FROM t3 WHERE y IS NULL;
    SELECT * FROM t3;
  }
} {234 567}












finish_test







>
>
>
>
>
>
>
>
>
>
>

81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
    INSERT INTO t3 VALUES(234,567);
    CREATE UNIQUE INDEX t3y ON t3(y);
    DELETE FROM t3 WHERE y IS NULL;
    SELECT * FROM t3;
  }
} {234 567}

do_test tkt3824-4.1 {
  db eval {
    CREATE TABLE t4(x,y);
    INSERT INTO t4 SELECT a, b FROM t1;
    INSERT INTO t4 VALUES(234,567);
    CREATE UNIQUE INDEX t4y ON t4(y);
    UPDATE t4 SET rowid=rowid+100 WHERE y IS NULL;
    SELECT rowid, x FROM t4 ORDER BY rowid;
  }
} {6 234 101 1 102 9 103 5 104 123 105 -10}

finish_test