SQLite

Check-in [c370338c77]
Login

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

Overview
Comment:Add tests to tkt-80ba201079.test.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c370338c772bcd0797a23f83c3f6dc019640c6dd
User & Date: dan 2010-12-07 07:57:50.000
Context
2010-12-07
14:32
Run some of the existing test scripts with optimizations disabled as part of all.test. (check-in: b0634d2f90 user: dan tags: trunk)
07:57
Add tests to tkt-80ba201079.test. (check-in: c370338c77 user: dan tags: trunk)
2010-12-06
21:09
Fix the build so that it once again works with SQLITE_OMIT_SHARED_CACHE and SQLITE_OMIT_AUTOVACUUM. (check-in: fabcb6b95e user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/tkt-80ba201079.test.
13
14
15
16
17
18
19

20
21
22
23
24
25
26
# resolved.  That ticket is about an incorrect result that appears when
# an index is added.  The root cause is that a constant is being used
# without initialization when the OR optimization applies in the WHERE clause.
#

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


do_test tkt-80ba2-100 {
  db eval {
    CREATE TABLE t1(a);
    INSERT INTO t1 VALUES('A');
    CREATE TABLE t2(b);
    INSERT INTO t2 VALUES('B');







>







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# resolved.  That ticket is about an incorrect result that appears when
# an index is added.  The root cause is that a constant is being used
# without initialization when the OR optimization applies in the WHERE clause.
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl
set ::testprefix tkt-80ba2

do_test tkt-80ba2-100 {
  db eval {
    CREATE TABLE t1(a);
    INSERT INTO t1 VALUES('A');
    CREATE TABLE t2(b);
    INSERT INTO t2 VALUES('B');
132
133
134
135
136
137
138
139


















































140
     WHERE (entry_types.name = 'cli_command' AND entry_id=2114)
        OR (entry_types.name = 'object_change'
             AND entry_id IN (SELECT change_id
                              FROM object_changes
                               WHERE obj_context = 'exported_pools'));
  }
} {300 object_change 2048}



















































finish_test








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
     WHERE (entry_types.name = 'cli_command' AND entry_id=2114)
        OR (entry_types.name = 'object_change'
             AND entry_id IN (SELECT change_id
                              FROM object_changes
                               WHERE obj_context = 'exported_pools'));
  }
} {300 object_change 2048}

#-------------------------------------------------------------------------
#

drop_all_tables
do_execsql_test 301 {
  CREATE TABLE t1(a, b, c);
  CREATE INDEX i1 ON t1(a);
  CREATE INDEX i2 ON t1(b);
  CREATE TABLE t2(d, e);

  INSERT INTO t1 VALUES('A', 'B', 'C');
  INSERT INTO t2 VALUES('D', 'E');
}

do_execsql_test 302 {
  SELECT * FROM t1, t2 WHERE
    (a='A' AND d='E') OR
    (b='B' AND c IN ('C', 'D', 'E'))
} {A B C D E}

do_execsql_test 303 {
  SELECT * FROM t1, t2 WHERE
    (a='A' AND d='E') OR
    (b='B' AND c IN (SELECT c FROM t1))
} {A B C D E}

do_execsql_test 304 {
  SELECT * FROM t1, t2 WHERE
    (a='A' AND d='E') OR
    (b='B' AND c IN (SELECT 'B' UNION SELECT 'C' UNION SELECT 'D'))
} {A B C D E}

do_execsql_test 305 {
  SELECT * FROM t1, t2 WHERE
    (b='B' AND c IN ('C', 'D', 'E')) OR
    (a='A' AND d='E')
} {A B C D E}

do_execsql_test 306 {
  SELECT * FROM t1, t2 WHERE
    (b='B' AND c IN (SELECT c FROM t1)) OR
    (a='A' AND d='E')
} {A B C D E}

do_execsql_test 307 {
  SELECT * FROM t1, t2 WHERE
    (b='B' AND c IN (SELECT 'B' UNION SELECT 'C' UNION SELECT 'D')) OR
    (a='A' AND d='E')
} {A B C D E}

finish_test