SQLite

Check-in [59c233942e]
Login

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

Overview
Comment:Add a test to ensure that the fix in [b0c1ba655d] has worked.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | mistake
Files: files | file ages | folders
SHA1: 59c233942e583086589c0bba5a3ff296a25c86a0
User & Date: dan 2012-12-04 05:21:53.168
Context
2012-12-04
05:21
Add a test to ensure that the fix in [b0c1ba655d] has worked. (Closed-Leaf check-in: 59c233942e user: dan tags: mistake)
2012-12-03
17:04
Make sure that the optimization that set the maximum column that will be used on a particular query does not mistakenly change an opcode other than OP_OpenRead or OP_OpenWrite. In particular, make sure it does not overwrite the P4 field of an OP_SorterOpen. (check-in: b0c1ba655d user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/vtab1.test.
1288
1289
1290
1291
1292
1293
1294








































1295
1296
} SQLITE_OK
do_test 19.2 {
  register_echo_module [sqlite3_connection_pointer db2]
} SQLITE_MISUSE
do_test 19.3 {
  db2 close
} {}









































finish_test







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


1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
} SQLITE_OK
do_test 19.2 {
  register_echo_module [sqlite3_connection_pointer db2]
} SQLITE_MISUSE
do_test 19.3 {
  db2 close
} {}

#-------------------------------------------------------------------------
# Test that the bug fixed by [b0c1ba655d69] really is fixed.
#
do_execsql_test 20.1 {
  CREATE TABLE t7 (a, b);
  CREATE TABLE t8 (c, d);
  CREATE INDEX i2 ON t7(a);
  CREATE INDEX i3 ON t7(b);
  CREATE INDEX i4 ON t8(c);
  CREATE INDEX i5 ON t8(d);

  CREATE VIRTUAL TABLE t7v USING echo(t7);
  CREATE VIRTUAL TABLE t8v USING echo(t8);
}

do_test 20.2 {
  for {set i 0} {$i < 1000} {incr i} {
    db eval {INSERT INTO t7 VALUES($i, $i)}
    db eval {INSERT INTO t8 VALUES($i, $i)}
  }
} {}

do_execsql_test 20.3 {
  SELECT a, b FROM (
      SELECT a, b FROM t7 WHERE a=11 OR b=12
      UNION ALL
      SELECT c, d FROM t8 WHERE c=5 OR d=6
  )
  ORDER BY 1, 2;
} {5 5 6 6 11 11 12 12}

do_execsql_test 20.4 {
  SELECT a, b FROM (
      SELECT a, b FROM t7v WHERE a=11 OR b=12
      UNION ALL
      SELECT c, d FROM t8v WHERE c=5 OR d=6
  )
  ORDER BY 1, 2;
} {5 5 6 6 11 11 12 12}

finish_test