/ Check-in [3934d2d0]
Login

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

Overview
Comment:Fix some test script issues that come up with SQLITE_OMIT_VIRTUALTABLE builds.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3934d2d08ee14d644dc01f967c10f219b76b172c963c90a7a8141f2b08a7d5bf
User & Date: dan 2019-10-03 14:36:36
Context
2019-10-03
14:51
Increase the precision of floating point value display in VDBE debugging output. No changes to normally deployed code. check-in: a561a656 user: drh tags: trunk
14:36
Fix some test script issues that come up with SQLITE_OMIT_VIRTUALTABLE builds. check-in: 3934d2d0 user: dan tags: trunk
13:44
Fix issues with command line invocation of wapptest.tcl. check-in: 9e0d5d26 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/loadext.c.

   459    459   #else
   460    460     0,
   461    461   #endif
   462    462     /* Version 3.28.0 and later */
   463    463     sqlite3_stmt_isexplain,
   464    464     sqlite3_value_frombind,
   465    465     /* Version 3.30.0 and later */
          466  +#ifndef SQLITE_OMIT_VIRTUALTABLE
   466    467     sqlite3_drop_modules,
          468  +#else
          469  +  0,
          470  +#endif
   467    471   };
   468    472   
   469    473   /*
   470    474   ** Attempt to load an SQLite extension library contained in the file
   471    475   ** zFile.  The entry point is zProc.  zProc may be 0 in which case a
   472    476   ** default entry point name (sqlite3_extension_init) is used.  Use
   473    477   ** of the default name is recommended.

Changes to test/without_rowid1.test.

    12     12   # This file implements regression tests for SQLite library.  The
    13     13   # focus of this file is testing WITHOUT ROWID tables.
    14     14   #
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   set testprefix without_rowid1
           19  +
           20  +proc do_execsql_test_if_vtab {tn sql {res {}}} {
           21  +  ifcapable vtab { uplevel [list do_execsql_test $tn $sql $res] }
           22  +}
    19     23   
    20     24   # Create and query a WITHOUT ROWID table.
    21     25   #
    22     26   do_execsql_test without_rowid1-1.0 {
    23     27     CREATE TABLE t1(a,b,c,d, PRIMARY KEY(c,a)) WITHOUT ROWID;
    24     28     CREATE INDEX t1bd ON t1(b, d);
    25     29     INSERT INTO t1 VALUES('journal','sherman','ammonia','helena');
................................................................................
    27     31     INSERT INTO t1 VALUES('journal','sherman','gamma','patriot');
    28     32     INSERT INTO t1 VALUES('arctic','sleep','ammonia','helena');
    29     33     SELECT *, '|' FROM t1 ORDER BY c, a;
    30     34   } {arctic sleep ammonia helena | journal sherman ammonia helena | dynamic juliet flipper command | journal sherman gamma patriot |}
    31     35   
    32     36   integrity_check without_rowid1-1.0ic
    33     37   
    34         -do_execsql_test without_rowid1-1.0ixi {
           38  +do_execsql_test_if_vtab without_rowid1-1.0ixi {
    35     39     SELECT name, key FROM pragma_index_xinfo('t1');
    36     40   } {c 1 a 1 b 0 d 0}
    37     41   
    38     42   do_execsql_test without_rowid1-1.1 {
    39     43     SELECT *, '|' FROM t1 ORDER BY +c, a;
    40     44   } {arctic sleep ammonia helena | journal sherman ammonia helena | dynamic juliet flipper command | journal sherman gamma patriot |}
    41     45   
................................................................................
   115    119     INSERT INTO t4 VALUES('abc', 'def');
   116    120     SELECT * FROM t4;
   117    121   } {abc def}
   118    122   do_execsql_test 2.1.2 {
   119    123     UPDATE t4 SET a = 'ABC';
   120    124     SELECT * FROM t4;
   121    125   } {ABC def}
   122         -do_execsql_test 2.1.3 {
          126  +do_execsql_test_if_vtab 2.1.3 {
   123    127     SELECT name, coll, key FROM pragma_index_xinfo('t4');
   124    128   } {a nocase 1 b BINARY 0}
   125    129   
   126    130   do_execsql_test 2.2.1 {
   127    131     DROP TABLE t4;
   128    132     CREATE TABLE t4 (b, a COLLATE nocase PRIMARY KEY) WITHOUT ROWID;
   129    133     INSERT INTO t4(a, b) VALUES('abc', 'def');
................................................................................
   131    135   } {def abc}
   132    136   
   133    137   do_execsql_test 2.2.2 {
   134    138     UPDATE t4 SET a = 'ABC', b = 'xyz';
   135    139     SELECT * FROM t4;
   136    140   } {xyz ABC}
   137    141   
   138         -do_execsql_test 2.2.3 {
          142  +do_execsql_test_if_vtab 2.2.3 {
   139    143     SELECT name, coll, key FROM pragma_index_xinfo('t4');
   140    144   } {a nocase 1 b BINARY 0}
   141    145   
   142    146   
   143    147   do_execsql_test 2.3.1 {
   144    148     CREATE TABLE t5 (a, b, PRIMARY KEY(b, a)) WITHOUT ROWID;
   145    149     INSERT INTO t5(a, b) VALUES('abc', 'def');
   146    150     UPDATE t5 SET a='abc', b='def';
   147    151   } {}
   148    152   
   149         -do_execsql_test 2.3.2 {
          153  +do_execsql_test_if_vtab 2.3.2 {
   150    154     SELECT name, coll, key FROM pragma_index_xinfo('t5');
   151    155   } {b BINARY 1 a BINARY 1}
   152    156   
   153    157   
   154    158   do_execsql_test 2.4.1 {
   155    159     CREATE TABLE t6 (
   156    160       a COLLATE nocase, b, c UNIQUE, PRIMARY KEY(b, a)
................................................................................
   161    165   } {}
   162    166   
   163    167   do_execsql_test 2.4.2 {
   164    168     SELECT * FROM t6 ORDER BY b, a;
   165    169     SELECT * FROM t6 ORDER BY c;
   166    170   } {ABC def ghi ABC def ghi}
   167    171   
   168         -do_execsql_test 2.4.3 {
          172  +do_execsql_test_if_vtab 2.4.3 {
   169    173     SELECT name, coll, key FROM pragma_index_xinfo('t6');
   170    174   } {b BINARY 1 a nocase 1 c BINARY 0}
   171    175   
   172    176   
   173    177   #-------------------------------------------------------------------------
   174    178   # Unless the destination table is completely empty, the xfer optimization 
   175    179   # is disabled for WITHOUT ROWID tables. The following tests check for

Changes to test/without_rowid6.test.

    11     11   #
    12     12   # Verify that WITHOUT ROWID tables work correctly when the PRIMARY KEY
    13     13   # has redundant columns.
    14     14   #
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
           18  +
           19  +proc do_execsql_test_if_vtab {tn sql {res {}}} {
           20  +  ifcapable vtab { uplevel [list do_execsql_test $tn $sql $res] }
           21  +}
    18     22   
    19     23   do_execsql_test without_rowid6-100 {
    20     24     CREATE TABLE t1(a,b,c,d,e, PRIMARY KEY(a,b,c,a,b,c,d,a,b,c)) WITHOUT ROWID;
    21     25     CREATE INDEX t1a ON t1(b, b);
    22     26     WITH RECURSIVE
    23     27       c(i) AS (VALUES(1) UNION ALL SELECT i+1 FROM c WHERE i<1000)
    24     28     INSERT INTO t1(a,b,c,d,e) SELECT i, i+1000, printf('x%dy',i), 0, 0 FROM c;
    25     29     ANALYZE;
    26     30   } {}
    27         -do_execsql_test without_rowid6-101 {
           31  +do_execsql_test_if_vtab without_rowid6-101 {
    28     32     SELECT name, key FROM pragma_index_xinfo('t1');
    29     33   } {a 1 b 1 c 1 d 1 e 0}
    30     34   do_execsql_test without_rowid6-110 {
    31     35     SELECT c FROM t1 WHERE a=123;
    32     36   } {x123y}
    33     37   do_execsql_test without_rowid6-120 {
    34     38     SELECT c FROM t1 WHERE b=1123;
................................................................................
    50     54       b UNIQUE,
    51     55       c UNIQUE,
    52     56       PRIMARY KEY(b)
    53     57     ) WITHOUT ROWID;
    54     58     INSERT INTO t1(a,b,c) VALUES(1,8,3),(4,5,6),(7,2,9);
    55     59     SELECT a FROM t1 WHERE b>3 ORDER BY b;
    56     60   } {4 1}
    57         -do_execsql_test without_rowid6-201 {
           61  +do_execsql_test_if_vtab without_rowid6-201 {
    58     62     SELECT name, key FROM pragma_index_xinfo('t1');
    59     63   } {b 1 a 0 c 0}
    60     64   do_execsql_test without_rowid6-210 {
    61     65     EXPLAIN QUERY PLAN
    62     66     SELECT a FROM t1 WHERE b>3 ORDER BY b;
    63     67   } {/SEARCH TABLE t1 USING PRIMARY KEY .b>../}
    64     68   do_execsql_test without_rowid6-220 {
................................................................................
   107    111     CREATE TABLE t1(a,b,c,
   108    112       UNIQUE(b,c),
   109    113       PRIMARY KEY(b,c)
   110    114     ) WITHOUT ROWID;
   111    115     INSERT INTO t1(a,b,c) VALUES(1,8,3),(4,5,6),(7,2,9);
   112    116     SELECT a FROM t1 WHERE b>3 ORDER BY b;
   113    117   } {4 1}
   114         -do_execsql_test without_rowid6-501 {
          118  +do_execsql_test_if_vtab without_rowid6-501 {
   115    119     SELECT name, key FROM pragma_index_xinfo('t1');
   116    120   } {b 1 c 1 a 0}
   117    121   do_execsql_test without_rowid6-510 {
   118    122     EXPLAIN QUERY PLAN
   119    123     SELECT a FROM t1 WHERE b>3 ORDER BY b;
   120    124   } {/SEARCH TABLE t1 USING PRIMARY KEY .b>../}
   121    125   do_execsql_test without_rowid6-520 {

Changes to test/without_rowid7.test.

    10     10   #*************************************************************************
    11     11   # This file implements regression tests for SQLite library.  
    12     12   #
    13     13   
    14     14   set testdir [file dirname $argv0]
    15     15   source $testdir/tester.tcl
    16     16   set testprefix without_rowid7
           17  +
           18  +proc do_execsql_test_if_vtab {tn sql {res {}}} {
           19  +  ifcapable vtab { uplevel [list do_execsql_test $tn $sql $res] }
           20  +}
    17     21   
    18     22   do_execsql_test 1.0 {
    19     23     CREATE TABLE t1(a, b COLLATE nocase, PRIMARY KEY(a, a, b)) WITHOUT ROWID;
    20     24   }
    21     25   
    22     26   do_catchsql_test 1.1 {
    23     27     INSERT INTO t1 VALUES(1, 'one'), (1, 'ONE');
................................................................................
    32     36     INSERT INTO t2 VALUES(1, 'one');
    33     37     SELECT b FROM t2;
    34     38   } {one}
    35     39   
    36     40   do_execsql_test 2.2a {
    37     41     PRAGMA index_info(t2);
    38     42   } {0 0 a 1 0 a}
    39         -do_execsql_test 2.2b {
           43  +do_execsql_test_if_vtab 2.2b {
    40     44     SELECT *, '|' FROM pragma_index_info('t2');
    41     45   } {0 0 a | 1 0 a |}
    42     46   do_execsql_test 2.3a {
    43     47     PRAGMA index_xinfo(t2);
    44     48   } {0 0 a 0 nocase 1 1 0 a 0 BINARY 1 2 1 b 0 BINARY 0}
    45         -do_execsql_test 2.3b {
           49  +do_execsql_test_if_vtab 2.3b {
    46     50     SELECT *, '|' FROM pragma_index_xinfo('t2');
    47     51   } {0 0 a 0 nocase 1 | 1 0 a 0 BINARY 1 | 2 1 b 0 BINARY 0 |}
    48     52   
    49     53   do_execsql_test 2.4 {
    50     54     CREATE TABLE t3(a, b, PRIMARY KEY(a COLLATE nocase, a));
    51     55     PRAGMA index_info(t3);
    52     56   } {}
    53     57   
    54     58   
    55     59   
    56     60   finish_test