/ Check-in [c058f483]
Login

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

Overview
Comment:Test file fixes for libaries compiled with various SQLITE_OMIT_ macros. (CVS 2961)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c058f483a52c8043178b6329aa5e58bedf0c8277
User & Date: danielk1977 2006-01-16 16:24:25
Context
2006-01-17
09:35
Test suite fixes for builds that define OMIT symbols. (CVS 2962) check-in: 3a54a33d user: danielk1977 tags: trunk
2006-01-16
16:24
Test file fixes for libaries compiled with various SQLITE_OMIT_ macros. (CVS 2961) check-in: c058f483 user: danielk1977 tags: trunk
15:32
Fix problems compiling with memory-management enabled. Ticket #1619. (CVS 2960) check-in: 36b03259 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/alter3.test.

     9      9   #
    10     10   #*************************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this script is testing that SQLite can handle a subtle 
    13     13   # file format change that may be used in the future to implement
    14     14   # "ALTER TABLE ... ADD COLUMN".
    15     15   #
    16         -# $Id: alter3.test,v 1.7 2005/12/30 16:28:02 danielk1977 Exp $
           16  +# $Id: alter3.test,v 1.8 2006/01/16 16:24:25 danielk1977 Exp $
    17     17   #
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   
    21     21   source $testdir/tester.tcl
    22     22   
    23     23   # If SQLITE_OMIT_ALTERTABLE is defined, omit this file.
................................................................................
    83     83   } {{CREATE TABLE t1(a, b, c)}}
    84     84   do_test alter3-1.5 {
    85     85     execsql {
    86     86       ALTER TABLE t1 ADD d CHECK (a>d);
    87     87       SELECT sql FROM sqlite_master WHERE tbl_name = 't1';
    88     88     }
    89     89   } {{CREATE TABLE t1(a, b, c, d CHECK (a>d))}}
    90         -do_test alter3-1.6 {
    91         -  execsql {
    92         -    CREATE TABLE t2(a, b, UNIQUE(a, b));
    93         -    ALTER TABLE t2 ADD c REFERENCES t1(c)  ;
    94         -    SELECT sql FROM sqlite_master WHERE tbl_name = 't2' AND type = 'table';
    95         -  }
    96         -} {{CREATE TABLE t2(a, b, c REFERENCES t1(c), UNIQUE(a, b))}}
           90  +ifcapable foreignkey {
           91  +  do_test alter3-1.6 {
           92  +    execsql {
           93  +      CREATE TABLE t2(a, b, UNIQUE(a, b));
           94  +      ALTER TABLE t2 ADD c REFERENCES t1(c)  ;
           95  +      SELECT sql FROM sqlite_master WHERE tbl_name = 't2' AND type = 'table';
           96  +    }
           97  +  } {{CREATE TABLE t2(a, b, c REFERENCES t1(c), UNIQUE(a, b))}}
           98  +}
    97     99   do_test alter3-1.7 {
    98    100     execsql {
    99    101       CREATE TABLE t3(a, b, UNIQUE(a, b));
   100    102       ALTER TABLE t3 ADD COLUMN c VARCHAR(10, 20);
   101    103       SELECT sql FROM sqlite_master WHERE tbl_name = 't3' AND type = 'table';
   102    104     }
   103    105   } {{CREATE TABLE t3(a, b, c VARCHAR(10, 20), UNIQUE(a, b))}}
   104    106   do_test alter3-1.99 {
          107  +  catchsql {
          108  +    # May not exist if foriegn-keys are omitted at compile time.
          109  +    DROP TABLE t2; 
          110  +  }
   105    111     execsql {
   106    112       DROP TABLE abc; 
   107    113       DROP TABLE t1; 
   108         -    DROP TABLE t2; 
   109    114       DROP TABLE t3; 
   110    115     }
   111    116   } {}
   112    117   
   113    118   do_test alter3-2.1 {
   114    119     execsql {
   115    120       CREATE TABLE t1(a, b);

Changes to test/attach.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this script is testing the ATTACH and DETACH commands
    13     13   # and related functionality.
    14     14   #
    15         -# $Id: attach.test,v 1.41 2005/11/29 03:13:22 drh Exp $
           15  +# $Id: attach.test,v 1.42 2006/01/16 16:24:25 danielk1977 Exp $
    16     16   #
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
    20     20   
    21     21   for {set i 2} {$i<=15} {incr i} {
    22     22     file delete -force test$i.db
................................................................................
   724    724   # Check the error message if we try to access a database that has
   725    725   # not been attached.
   726    726   do_test attach-6.3 {
   727    727     catchsql {
   728    728       CREATE TABLE no_such_db.t1(a, b, c);
   729    729     }
   730    730   } {1 {unknown database no_such_db}}
   731         -ifcapable !compound {
   732         -  do_test attach-6.4 {
   733         -    catchsql {
   734         -      CREATE TEMP TABLE db2.temp1(a, b, c);
   735         -    }
   736         -  } {1 {temporary table name must be unqualified}}
   737         -}
   738    731   for {set i 2} {$i<=15} {incr i} {
   739    732     catch {db$i close}
   740    733   }
   741    734   db close
   742    735   file delete -force test2.db
   743    736   file delete -force no-such-file
   744    737   
   745    738   finish_test

Changes to test/auth.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this script is testing the ATTACH and DETACH commands
    13     13   # and related functionality.
    14     14   #
    15         -# $Id: auth.test,v 1.31 2006/01/16 15:14:28 danielk1977 Exp $
           15  +# $Id: auth.test,v 1.32 2006/01/16 16:24:25 danielk1977 Exp $
    16     16   #
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
    20     20   
    21     21   # disable this test if the SQLITE_OMIT_AUTHORIZATION macro is
    22     22   # defined during compilation.
................................................................................
  2206   2206     execsql {
  2207   2207       SELECT count(a) AS cnt FROM t4 ORDER BY cnt
  2208   2208     }
  2209   2209   } {1}
  2210   2210   
  2211   2211   # Ticket #1607
  2212   2212   #
  2213         -do_test auth-5.2 {
  2214         -  execsql {
  2215         -    SELECT name FROM (
  2216         -      SELECT * FROM sqlite_master UNION ALL SELECT * FROM sqlite_temp_master)
  2217         -    WHERE type='table'
  2218         -    ORDER BY name
  2219         -  }
  2220         -} {sqlite_stat1 t1 t2 t3 t4 tx v1chng}
         2213  +ifcapable compound {
         2214  +  do_test auth-5.2 {
         2215  +    execsql {
         2216  +      SELECT name FROM (
         2217  +        SELECT * FROM sqlite_master UNION ALL SELECT * FROM sqlite_temp_master)
         2218  +      WHERE type='table'
         2219  +      ORDER BY name
         2220  +    }
         2221  +  } {sqlite_stat1 t1 t2 t3 t4 tx v1chng}
         2222  +}
  2221   2223   
  2222   2224   
  2223   2225   rename proc {}
  2224   2226   rename proc_real proc
  2225   2227   
  2226   2228   
  2227   2229   finish_test

Changes to test/autovacuum.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing the SELECT statement.
    13     13   #
    14         -# $Id: autovacuum.test,v 1.19 2005/09/16 09:52:30 danielk1977 Exp $
           14  +# $Id: autovacuum.test,v 1.20 2006/01/16 16:24:25 danielk1977 Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   # If this build of the library does not support auto-vacuum, omit this
    20     20   # whole file.
    21         -ifcapable {!autovacuum} {
           21  +ifcapable {!autovacuum || !pragma} {
    22     22     finish_test
    23     23     return
    24     24   }
    25     25   
    26     26   # Return a string $len characters long. The returned string is $char repeated
    27     27   # over and over. For example, [make_str abc 8] returns "abcabcab".
    28     28   proc make_str {char len} {

Changes to test/cast.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing the CAST operator.
    13     13   #
    14         -# $Id: cast.test,v 1.3 2005/11/01 15:48:25 drh Exp $
           14  +# $Id: cast.test,v 1.4 2006/01/16 16:24:25 danielk1977 Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   # Only run these tests if the build includes the CAST operator
    20     20   ifcapable !cast {
    21     21     finish_test
    22     22     return
    23     23   }
    24     24   
    25     25   # Tests for the CAST( AS blob), CAST( AS text) and CAST( AS numeric) built-ins
    26     26   #
    27         -do_test cast-1.1 {
    28         -  execsql {SELECT x'616263'}
    29         -} abc
    30         -do_test cast-1.2 {
    31         -  execsql {SELECT typeof(x'616263')}
    32         -} blob
    33         -do_test cast-1.3 {
    34         -  execsql {SELECT CAST(x'616263' AS text)}
    35         -} abc
    36         -do_test cast-1.4 {
    37         -  execsql {SELECT typeof(CAST(x'616263' AS text))}
    38         -} text
    39         -do_test cast-1.5 {
    40         -  execsql {SELECT CAST(x'616263' AS numeric)}
    41         -} 0
    42         -do_test cast-1.6 {
    43         -  execsql {SELECT typeof(CAST(x'616263' AS numeric))}
    44         -} integer
    45         -do_test cast-1.7 {
    46         -  execsql {SELECT CAST(x'616263' AS blob)}
    47         -} abc
    48         -do_test cast-1.8 {
    49         -  execsql {SELECT typeof(CAST(x'616263' AS blob))}
    50         -} blob
    51         -do_test cast-1.9 {
    52         -  execsql {SELECT CAST(x'616263' AS integer)}
    53         -} 0
    54         -do_test cast-1.10 {
    55         -  execsql {SELECT typeof(CAST(x'616263' AS integer))}
    56         -} integer
           27  +ifcapable bloblit {
           28  +  do_test cast-1.1 {
           29  +    execsql {SELECT x'616263'}
           30  +  } abc
           31  +  do_test cast-1.2 {
           32  +    execsql {SELECT typeof(x'616263')}
           33  +  } blob
           34  +  do_test cast-1.3 {
           35  +    execsql {SELECT CAST(x'616263' AS text)}
           36  +  } abc
           37  +  do_test cast-1.4 {
           38  +    execsql {SELECT typeof(CAST(x'616263' AS text))}
           39  +  } text
           40  +  do_test cast-1.5 {
           41  +    execsql {SELECT CAST(x'616263' AS numeric)}
           42  +  } 0
           43  +  do_test cast-1.6 {
           44  +    execsql {SELECT typeof(CAST(x'616263' AS numeric))}
           45  +  } integer
           46  +  do_test cast-1.7 {
           47  +    execsql {SELECT CAST(x'616263' AS blob)}
           48  +  } abc
           49  +  do_test cast-1.8 {
           50  +    execsql {SELECT typeof(CAST(x'616263' AS blob))}
           51  +  } blob
           52  +  do_test cast-1.9 {
           53  +    execsql {SELECT CAST(x'616263' AS integer)}
           54  +  } 0
           55  +  do_test cast-1.10 {
           56  +    execsql {SELECT typeof(CAST(x'616263' AS integer))}
           57  +  } integer
           58  +}
    57     59   do_test cast-1.11 {
    58     60     execsql {SELECT null}
    59     61   } {{}}
    60     62   do_test cast-1.12 {
    61     63     execsql {SELECT typeof(NULL)}
    62     64   } null
    63     65   do_test cast-1.13 {

Changes to test/descidx1.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #*************************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this script is descending indices.
    13     13   #
    14         -# $Id: descidx1.test,v 1.4 2006/01/12 01:56:44 drh Exp $
           14  +# $Id: descidx1.test,v 1.5 2006/01/16 16:24:25 danielk1977 Exp $
    15     15   #
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   # This procedure sets the value of the file-format in file 'test.db'
    21     21   # to $newval. Also, the schema cookie is incremented.
................................................................................
   166    166   do_test descidx1-3.26 {
   167    167     cksort {SELECT b FROM t1 WHERE a>3 AND a<8 ORDER BY a DESC}
   168    168   } {7 6 5 4 nosort}
   169    169   
   170    170   # Create a table with indices that are descending on some terms and
   171    171   # ascending on others.
   172    172   #
   173         -do_test descidx1-4.1 {
   174         -  execsql {
   175         -    CREATE TABLE t2(a INT, b TEXT, c BLOB, d REAL);
   176         -    CREATE INDEX i3 ON t2(a ASC, b DESC, c ASC);
   177         -    CREATE INDEX i4 ON t2(b DESC, a ASC, d DESC);
   178         -    INSERT INTO t2 VALUES(1,'one',x'31',1.0);
   179         -    INSERT INTO t2 VALUES(2,'two',x'3232',2.0);
   180         -    INSERT INTO t2 VALUES(3,'three',x'333333',3.0);
   181         -    INSERT INTO t2 VALUES(4,'four',x'34343434',4.0);
   182         -    INSERT INTO t2 VALUES(5,'five',x'3535353535',5.0);
   183         -    INSERT INTO t2 VALUES(6,'six',x'363636363636',6.0);
   184         -    INSERT INTO t2 VALUES(2,'two',x'323232',2.1);
   185         -    INSERT INTO t2 VALUES(2,'zwei',x'3232',2.2);
   186         -    INSERT INTO t2 VALUES(2,NULL,NULL,2.3);
   187         -    SELECT count(*) FROM t2;
   188         -  }
   189         -} {9}
   190         -do_test descidx1-4.2 {
   191         -  execsql {
   192         -    SELECT d FROM t2 ORDER BY a;
   193         -  }
   194         -} {1.0 2.2 2.0 2.1 2.3 3.0 4.0 5.0 6.0}
   195         -do_test descidx1-4.3 {
   196         -  execsql {
   197         -    SELECT d FROM t2 WHERE a>=2;
   198         -  }
   199         -} {2.2 2.0 2.1 2.3 3.0 4.0 5.0 6.0}
   200         -do_test descidx1-4.4 {
   201         -  execsql {
   202         -    SELECT d FROM t2 WHERE a>2;
   203         -  }
   204         -} {3.0 4.0 5.0 6.0}
   205         -do_test descidx1-4.5 {
   206         -  execsql {
   207         -    SELECT d FROM t2 WHERE a=2 AND b>'two';
   208         -  }
   209         -} {2.2}
   210         -do_test descidx1-4.6 {
   211         -  execsql {
   212         -    SELECT d FROM t2 WHERE a=2 AND b>='two';
   213         -  }
   214         -} {2.2 2.0 2.1}
   215         -do_test descidx1-4.7 {
   216         -  execsql {
   217         -    SELECT d FROM t2 WHERE a=2 AND b<'two';
   218         -  }
   219         -} {}
   220         -do_test descidx1-4.8 {
   221         -  execsql {
   222         -    SELECT d FROM t2 WHERE a=2 AND b<='two';
   223         -  }
   224         -} {2.0 2.1}
          173  +ifcapable bloblit {
          174  +  do_test descidx1-4.1 {
          175  +    execsql {
          176  +      CREATE TABLE t2(a INT, b TEXT, c BLOB, d REAL);
          177  +      CREATE INDEX i3 ON t2(a ASC, b DESC, c ASC);
          178  +      CREATE INDEX i4 ON t2(b DESC, a ASC, d DESC);
          179  +      INSERT INTO t2 VALUES(1,'one',x'31',1.0);
          180  +      INSERT INTO t2 VALUES(2,'two',x'3232',2.0);
          181  +      INSERT INTO t2 VALUES(3,'three',x'333333',3.0);
          182  +      INSERT INTO t2 VALUES(4,'four',x'34343434',4.0);
          183  +      INSERT INTO t2 VALUES(5,'five',x'3535353535',5.0);
          184  +      INSERT INTO t2 VALUES(6,'six',x'363636363636',6.0);
          185  +      INSERT INTO t2 VALUES(2,'two',x'323232',2.1);
          186  +      INSERT INTO t2 VALUES(2,'zwei',x'3232',2.2);
          187  +      INSERT INTO t2 VALUES(2,NULL,NULL,2.3);
          188  +      SELECT count(*) FROM t2;
          189  +    }
          190  +  } {9}
          191  +  do_test descidx1-4.2 {
          192  +    execsql {
          193  +      SELECT d FROM t2 ORDER BY a;
          194  +    }
          195  +  } {1.0 2.2 2.0 2.1 2.3 3.0 4.0 5.0 6.0}
          196  +  do_test descidx1-4.3 {
          197  +    execsql {
          198  +      SELECT d FROM t2 WHERE a>=2;
          199  +    }
          200  +  } {2.2 2.0 2.1 2.3 3.0 4.0 5.0 6.0}
          201  +  do_test descidx1-4.4 {
          202  +    execsql {
          203  +      SELECT d FROM t2 WHERE a>2;
          204  +    }
          205  +  } {3.0 4.0 5.0 6.0}
          206  +  do_test descidx1-4.5 {
          207  +    execsql {
          208  +      SELECT d FROM t2 WHERE a=2 AND b>'two';
          209  +    }
          210  +  } {2.2}
          211  +  do_test descidx1-4.6 {
          212  +    execsql {
          213  +      SELECT d FROM t2 WHERE a=2 AND b>='two';
          214  +    }
          215  +  } {2.2 2.0 2.1}
          216  +  do_test descidx1-4.7 {
          217  +    execsql {
          218  +      SELECT d FROM t2 WHERE a=2 AND b<'two';
          219  +    }
          220  +  } {}
          221  +  do_test descidx1-4.8 {
          222  +    execsql {
          223  +      SELECT d FROM t2 WHERE a=2 AND b<='two';
          224  +    }
          225  +  } {2.0 2.1}
          226  +}
   225    227   
   226    228   do_test descidx1-5.1 {
   227    229     execsql {
   228    230       CREATE TABLE t3(a,b,c,d);
   229    231       CREATE INDEX t3i1 ON t3(a DESC, b ASC, c DESC, d ASC);
   230    232       INSERT INTO t3 VALUES(0,0,0,0);
   231    233       INSERT INTO t3 VALUES(0,0,0,1);

Changes to test/descidx3.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #*************************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this script is descending indices.
    13     13   #
    14         -# $Id: descidx3.test,v 1.2 2006/01/14 08:02:28 danielk1977 Exp $
           14  +# $Id: descidx3.test,v 1.3 2006/01/16 16:24:25 danielk1977 Exp $
    15     15   #
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
           19  +
           20  +ifcapable !bloblit {
           21  +  finish_test
           22  +  return
           23  +}
    19     24   
    20     25   # This procedure sets the value of the file-format in file 'test.db'
    21     26   # to $newval. Also, the schema cookie is incremented.
    22     27   # 
    23     28   proc set_file_format {newval} {
    24     29     set bt [btree_open test.db 10 0]
    25     30     btree_begin_transaction $bt

Changes to test/hook.test.

    13     13   #
    14     14   # The focus of the tests in this file is the  following interface:
    15     15   #
    16     16   #      sqlite_commit_hook    (tests hook-1..hook-3 inclusive)
    17     17   #      sqlite_update_hook    (tests hook-4-*)
    18     18   #      sqlite_rollback_hook  (tests hook-5.*)
    19     19   #
    20         -# $Id: hook.test,v 1.9 2006/01/05 23:42:52 drh Exp $
           20  +# $Id: hook.test,v 1.10 2006/01/16 16:24:25 danielk1977 Exp $
    21     21   
    22     22   set testdir [file dirname $argv0]
    23     23   source $testdir/tester.tcl
    24     24   
    25     25   do_test hook-1.2 {
    26     26     db commit_hook
    27     27   } {}
................................................................................
   205    205       UPDATE main t1 1 \
   206    206       UPDATE main t1 2 \
   207    207       UPDATE main t1 3 \
   208    208       DELETE main t1 2 \
   209    209       DELETE main t1 3 \
   210    210   ]
   211    211   set ::update_hook {}
   212         -do_test hook-4.3.2 {
   213         -  execsql {
   214         -    SELECT * FROM t1 UNION SELECT * FROM t3;
   215         -    SELECT * FROM t1 UNION ALL SELECT * FROM t3;
   216         -    SELECT * FROM t1 INTERSECT SELECT * FROM t3;
   217         -    SELECT * FROM t1 EXCEPT SELECT * FROM t3;
   218         -    SELECT * FROM t1 ORDER BY b;
   219         -    SELECT * FROM t1 GROUP BY b;
   220         -  }
   221         -  set ::update_hook
   222         -} [list]
          212  +ifcapable compound {
          213  +  do_test hook-4.3.2 {
          214  +    execsql {
          215  +      SELECT * FROM t1 UNION SELECT * FROM t3;
          216  +      SELECT * FROM t1 UNION ALL SELECT * FROM t3;
          217  +      SELECT * FROM t1 INTERSECT SELECT * FROM t3;
          218  +      SELECT * FROM t1 EXCEPT SELECT * FROM t3;
          219  +      SELECT * FROM t1 ORDER BY b;
          220  +      SELECT * FROM t1 GROUP BY b;
          221  +    }
          222  +    set ::update_hook
          223  +  } [list]
          224  +}
   223    225   db update_hook {}
   224    226   #
   225    227   #----------------------------------------------------------------------------
   226    228   
   227    229   #----------------------------------------------------------------------------
   228    230   # Test the rollback-hook. The rollback-hook is a bit more complicated than
   229    231   # either the commit or update hooks because a rollback can happen 

Changes to test/insert.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing the INSERT statement.
    13     13   #
    14         -# $Id: insert.test,v 1.27 2005/07/08 17:13:47 drh Exp $
           14  +# $Id: insert.test,v 1.28 2006/01/16 16:24:25 danielk1977 Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   # Try to insert into a non-existant table.
    20     20   #
    21     21   do_test insert-1.1 {
................................................................................
   342    342     }
   343    343   } {1 2 2}
   344    344   
   345    345   # Ticket #1140:  Check for an infinite loop in the algorithm that tests
   346    346   # to see if the right-hand side of an INSERT...SELECT references the left-hand
   347    347   # side.
   348    348   #
   349         -ifcapable subquery {
          349  +ifcapable subquery&&compound {
   350    350     do_test insert-8.1 {
   351    351       execsql {
   352    352         INSERT INTO t3 SELECT * FROM (SELECT * FROM t3 UNION ALL SELECT 1,2,3)
   353    353       }
   354    354     } {}
   355    355   }
   356    356   
   357    357   
   358    358   integrity_check insert-99.0
   359    359   
   360    360   finish_test

Changes to test/misc5.test.

     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.
    12     12   #
    13     13   # This file implements tests for miscellanous features that were
    14     14   # left out of other test files.
    15     15   #
    16         -# $Id: misc5.test,v 1.9 2006/01/14 08:02:28 danielk1977 Exp $
           16  +# $Id: misc5.test,v 1.10 2006/01/16 16:24:25 danielk1977 Exp $
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
    20     20   
    21     21   # Build records using the MakeRecord opcode such that the size of the 
    22     22   # header is at the transition point in the size of a varint.
    23     23   #
................................................................................
   506    506   
   507    507   # Ticket #1582.  Ensure that an unknown table in a LIMIT clause applied to
   508    508   # a UNION ALL query causes an error, not a crash.
   509    509   #
   510    510   db close
   511    511   file delete -force test.db
   512    512   sqlite3 db test.db
   513         -ifcapable subquery {
          513  +ifcapable subquery&&compound {
   514    514     do_test misc5-6.1 {
   515    515       catchsql {
   516    516         SELECT * FROM sqlite_master 
   517    517         UNION ALL 
   518    518         SELECT * FROM sqlite_master
   519    519         LIMIT (SELECT count(*) FROM blah);
   520    520       }

Changes to test/shared.test.

     5      5   #
     6      6   #    May you do good and not evil.
     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12         -# $Id: shared.test,v 1.15 2006/01/16 15:14:29 danielk1977 Exp $
           12  +# $Id: shared.test,v 1.16 2006/01/16 16:24:25 danielk1977 Exp $
    13     13   
    14     14   set testdir [file dirname $argv0]
    15     15   source $testdir/tester.tcl
    16     16   db close
    17     17   
    18     18   ifcapable !shared_cache {
    19     19     finish_test
................................................................................
   332    332   # Open a write-transaction using handle 1 and modify the database schema.
   333    333   # Then try to execute a compiled statement to read from the same 
   334    334   # database via handle 2 (fails to get the lock on sqlite_master). Also
   335    335   # try to compile a read of the same database using handle 2 (also fails).
   336    336   # Finally, compile a read of the other database using handle 2. This
   337    337   # should also fail.
   338    338   #
   339         -do_test shared-$av.4.4.1.2 {
   340         -  # Sanity check 1: Check that the schema is what we think it is when viewed
   341         -  # via handle 1.
   342         -  execsql {
   343         -    CREATE TABLE test2.ghi(g, h, i);
   344         -    SELECT 'test.db:'||name FROM sqlite_master 
   345         -    UNION ALL
   346         -    SELECT 'test2.db:'||name FROM test2.sqlite_master;
   347         -  }
   348         -} {test.db:abc test.db:def test2.db:ghi}
   349         -do_test shared-$av.4.4.1.2 {
   350         -  # Sanity check 2: Check that the schema is what we think it is when viewed
   351         -  # via handle 2.
   352         -  execsql {
   353         -    SELECT 'test2.db:'||name FROM sqlite_master 
   354         -    UNION ALL
   355         -    SELECT 'test.db:'||name FROM test.sqlite_master;
   356         -  } db2
   357         -} {test2.db:ghi test.db:abc test.db:def}
          339  +ifcapable compound {
          340  +  do_test shared-$av.4.4.1.2 {
          341  +    # Sanity check 1: Check that the schema is what we think it is when viewed
          342  +    # via handle 1.
          343  +    execsql {
          344  +      CREATE TABLE test2.ghi(g, h, i);
          345  +      SELECT 'test.db:'||name FROM sqlite_master 
          346  +      UNION ALL
          347  +      SELECT 'test2.db:'||name FROM test2.sqlite_master;
          348  +    }
          349  +  } {test.db:abc test.db:def test2.db:ghi}
          350  +  do_test shared-$av.4.4.1.2 {
          351  +    # Sanity check 2: Check that the schema is what we think it is when viewed
          352  +    # via handle 2.
          353  +    execsql {
          354  +      SELECT 'test2.db:'||name FROM sqlite_master 
          355  +      UNION ALL
          356  +      SELECT 'test.db:'||name FROM test.sqlite_master;
          357  +    } db2
          358  +  } {test2.db:ghi test.db:abc test.db:def}
          359  +}
   358    360   
   359    361   do_test shared-$av.4.4.2 {
   360    362     set ::DB2 [sqlite3_connection_pointer db2]
   361    363     set sql {SELECT * FROM abc}
   362    364     set ::STMT1 [sqlite3_prepare $::DB2 $sql -1 DUMMY]
   363    365     execsql {
   364    366       BEGIN;
................................................................................
   418    420     execsql {
   419    421       DROP INDEX i1;
   420    422       DROP VIEW v1;
   421    423       DROP TRIGGER trig1;
   422    424       DROP TABLE t1;
   423    425     } db2
   424    426   } {}
   425         -do_test shared-$av.5.1.2 {
   426         -  execsql {
   427         -    SELECT * FROM sqlite_master UNION ALL SELECT * FROM test1.sqlite_master
   428         -  } db1
   429         -} {}
          427  +ifcapable compound {
          428  +  do_test shared-$av.5.1.2 {
          429  +    execsql {
          430  +      SELECT * FROM sqlite_master UNION ALL SELECT * FROM test1.sqlite_master
          431  +    } db1
          432  +  } {}
          433  +}
   430    434   
   431    435   #--------------------------------------------------------------------------
   432    436   # Tests shared-6.* test that a query obtains all the read-locks it needs
   433    437   # before starting execution of the query. This means that there is no chance
   434    438   # some rows of data will be returned before a lock fails and SQLITE_LOCK
   435    439   # is returned.
   436    440   #
................................................................................
   437    441   do_test shared-$av.6.1.1 {
   438    442     execsql {
   439    443       CREATE TABLE t1(a, b);
   440    444       CREATE TABLE t2(a, b);
   441    445       INSERT INTO t1 VALUES(1, 2);
   442    446       INSERT INTO t2 VALUES(3, 4);
   443    447     } db1
   444         -  execsql {
   445         -    SELECT * FROM t1 UNION ALL SELECT * FROM t2;
   446         -  } db2
   447         -} {1 2 3 4}
   448         -do_test shared-$av.6.1.2 {
          448  +} {}
          449  +ifcapable compound {
          450  +  do_test shared-$av.6.1.2 {
          451  +    execsql {
          452  +      SELECT * FROM t1 UNION ALL SELECT * FROM t2;
          453  +    } db2
          454  +  } {1 2 3 4}
          455  +}
          456  +do_test shared-$av.6.1.3 {
   449    457     # Establish a write lock on table t2 via connection db2. Then make a 
   450    458     # UNION all query using connection db1 that first accesses t1, followed 
   451    459     # by t2. If the locks are grabbed at the start of the statement (as 
   452    460     # they should be), no rows are returned. If (as was previously the case)
   453    461     # they are grabbed as the tables are accessed, the t1 rows will be 
   454    462     # returned before the query fails.
   455    463     #
................................................................................
   461    469     catch {
   462    470       db1 eval {SELECT * FROM t1 UNION ALL SELECT * FROM t2} {
   463    471         lappend ret $a $b
   464    472       }
   465    473     }
   466    474     set ret
   467    475   } {}
   468         -do_test shared-$av.6.1.3 {
          476  +do_test shared-$av.6.1.4 {
   469    477     execsql {
   470    478       COMMIT;
   471    479       BEGIN;
   472    480       INSERT INTO t1 VALUES(7, 8);
   473    481     } db2
   474    482     set ret [list]
   475    483     catch {

Changes to test/tkt1444.test.

    12     12   #
    13     13   # This file implements tests to verify that ticket #1444 has been
    14     14   # fixed.  
    15     15   #
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
           19  +
           20  +ifcapable compound {
           21  +  finish_test
           22  +  return 
           23  +}
    19     24   
    20     25   # The use of a VIEW that contained an ORDER BY clause within a UNION ALL
    21     26   # was causing problems.  See ticket #1444.
    22     27   #
    23     28   do_test tkt1444-1.1 {
    24     29     execsql {
    25     30       CREATE TABLE DemoTable (x INTEGER, TextKey TEXT, DKey Real);

Changes to test/tkt1473.test.

    12     12   #
    13     13   # This file implements tests to verify that ticket #1473 has been
    14     14   # fixed.  
    15     15   #
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
           19  +
           20  +ifcapable compound {
           21  +  finish_test
           22  +  return 
           23  +}
    19     24   
    20     25   do_test tkt1473-1.1 {
    21     26     execsql {
    22     27       CREATE TABLE t1(a,b);
    23     28       INSERT INTO t1 VALUES(1,2);
    24     29       INSERT INTO t1 VALUES(3,4);
    25     30       SELECT * FROM t1

Changes to test/types3.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library. The focus
    12     12   # of this file is testing the interaction of SQLite manifest types
    13     13   # with Tcl dual-representations.
    14     14   #
    15         -# $Id: types3.test,v 1.3 2005/11/14 22:29:06 drh Exp $
           15  +# $Id: types3.test,v 1.4 2006/01/16 16:24:25 danielk1977 Exp $
    16     16   #
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
    20     20   
    21     21   # A variable with only a string representation comes in as TEXT
    22     22   do_test types3-1.1 {
................................................................................
    52     52     set V "abc"
    53     53     binary scan $V a3 x
    54     54     concat [tcl_variable_type V] [execsql {SELECT typeof($::V)}]
    55     55   } {bytearray text}
    56     56   
    57     57   # Check to make sure return values are of the right types.
    58     58   #
    59         -do_test types3-2.1 {
    60         -  set V [db one {SELECT x'616263'}]
    61         -  tcl_variable_type V
    62         -} bytearray
           59  +ifcapable bloblit {
           60  +  do_test types3-2.1 {
           61  +    set V [db one {SELECT x'616263'}]
           62  +    tcl_variable_type V
           63  +  } bytearray
           64  +}
    63     65   do_test types3-2.2 {
    64     66     set V [db one {SELECT 123}]
    65     67     tcl_variable_type V
    66     68   } int
    67     69   do_test types3-2.3 {
    68     70     set V [db one {SELECT 1234567890123456}]
    69     71     tcl_variable_type V

Changes to test/vacuum2.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing the VACUUM statement.
    13     13   #
    14         -# $Id: vacuum2.test,v 1.1 2005/02/16 03:27:08 drh Exp $
           14  +# $Id: vacuum2.test,v 1.2 2006/01/16 16:24:25 danielk1977 Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   # If the VACUUM statement is disabled in the current build, skip all
    20     20   # the tests in this file.
    21     21   #
    22         -ifcapable {!vacuum} {
           22  +ifcapable {!vacuum||!autoinc} {
    23     23     finish_test
    24     24     return
    25     25   }
    26     26   if $AUTOVACUUM {
    27     27     finish_test
    28     28     return
    29     29   }

Changes to test/where2.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing the use of indices in WHERE clauses
    13     13   # based on recent changes to the optimizer.
    14     14   #
    15         -# $Id: where2.test,v 1.6 2006/01/14 08:02:29 danielk1977 Exp $
           15  +# $Id: where2.test,v 1.7 2006/01/16 16:24:25 danielk1977 Exp $
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   # Build some test data
    21     21   #
    22     22   do_test where2-1.0 {
................................................................................
   142    142     do_test where2-4.3 {
   143    143       queryplan {
   144    144         SELECT * FROM t1 WHERE z=10006 AND y IN (10000,10201)
   145    145                          AND x>0 AND x<10
   146    146         ORDER BY w
   147    147       }
   148    148     } {99 6 10000 10006 sort t1 i1zyx}
   149         -  do_test where2-4.4 {
   150         -    queryplan {
   151         -      SELECT * FROM t1 WHERE z IN (SELECT 10207 UNION SELECT 10006)
   152         -                       AND y IN (10000,10201)
   153         -                       AND x>0 AND x<10
   154         -      ORDER BY w
   155         -    }
   156         -  } {99 6 10000 10006 100 6 10201 10207 sort t1 i1zyx}
   157         -  do_test where2-4.5 {
   158         -    queryplan {
   159         -      SELECT * FROM t1 WHERE z IN (SELECT 10207 UNION SELECT 10006)
   160         -                       AND y IN (SELECT 10000 UNION SELECT 10201)
   161         -                       AND x>0 AND x<10
   162         -      ORDER BY w
   163         -    }
   164         -  } {99 6 10000 10006 100 6 10201 10207 sort t1 i1zyx}
          149  +  ifcapable compound {
          150  +    do_test where2-4.4 {
          151  +      queryplan {
          152  +        SELECT * FROM t1 WHERE z IN (SELECT 10207 UNION SELECT 10006)
          153  +                         AND y IN (10000,10201)
          154  +                         AND x>0 AND x<10
          155  +        ORDER BY w
          156  +      }
          157  +    } {99 6 10000 10006 100 6 10201 10207 sort t1 i1zyx}
          158  +    do_test where2-4.5 {
          159  +      queryplan {
          160  +        SELECT * FROM t1 WHERE z IN (SELECT 10207 UNION SELECT 10006)
          161  +                         AND y IN (SELECT 10000 UNION SELECT 10201)
          162  +                         AND x>0 AND x<10
          163  +        ORDER BY w
          164  +      }
          165  +    } {99 6 10000 10006 100 6 10201 10207 sort t1 i1zyx}
          166  +  }
   165    167     do_test where2-4.6 {
   166    168       queryplan {
   167    169         SELECT * FROM t1
   168    170          WHERE x IN (1,2,3,4,5,6,7,8)
   169    171            AND y IN (10000,10001,10002,10003,10004,10005)
   170    172          ORDER BY 2
   171    173       }
................................................................................
   176    178     #
   177    179     do_test where2-4.6 {
   178    180       queryplan {
   179    181         SELECT * FROM t1 WHERE z IN (10207,10006,10006,10207)
   180    182         ORDER BY w
   181    183       }
   182    184     } {99 6 10000 10006 100 6 10201 10207 sort t1 i1zyx}
   183         -  do_test where2-4.7 {
   184         -    queryplan {
   185         -      SELECT * FROM t1 WHERE z IN (
   186         -         SELECT 10207 UNION ALL SELECT 10006
   187         -         UNION ALL SELECT 10006 UNION ALL SELECT 10207)
   188         -      ORDER BY w
   189         -    }
   190         -  } {99 6 10000 10006 100 6 10201 10207 sort t1 i1zyx}
          185  +  ifcapable compound {
          186  +    do_test where2-4.7 {
          187  +      queryplan {
          188  +        SELECT * FROM t1 WHERE z IN (
          189  +           SELECT 10207 UNION ALL SELECT 10006
          190  +           UNION ALL SELECT 10006 UNION ALL SELECT 10207)
          191  +        ORDER BY w
          192  +      }
          193  +    } {99 6 10000 10006 100 6 10201 10207 sort t1 i1zyx}
          194  +  }
   191    195   
   192    196   } ;# ifcapable subquery
   193    197   
   194    198   # The use of an IN operator disables the index as a sorter.
   195    199   #
   196    200   do_test where2-5.1 {
   197    201     queryplan {