/ Check-in [9ca975c8]
Login

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

Overview
Comment:Fix (make test) with SQLITE_OMIT_COMPOUND_SELECT. Ticket #3235. (CVS 5530)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9ca975c8fdeaae7d5af8fe62e097d8d251362cfe
User & Date: danielk1977 2008-08-04 03:51:24
Context
2008-08-04
04:28
Add the pkgconfigdir variable to Makefile.in. Ticket #3242. (CVS 5531) check-in: 540c9d4c user: danielk1977 tags: trunk
03:51
Fix (make test) with SQLITE_OMIT_COMPOUND_SELECT. Ticket #3235. (CVS 5530) check-in: 9ca975c8 user: danielk1977 tags: trunk
01:46
removed some extraneous blank lines. made sure to use only LF line endings. (CVS 5529) check-in: 358bd660 user: shane tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/select.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains C code routines that are called by the parser
    13     13   ** to handle SELECT statements in SQLite.
    14     14   **
    15         -** $Id: select.c,v 1.462 2008/08/02 03:50:39 drh Exp $
           15  +** $Id: select.c,v 1.463 2008/08/04 03:51:24 danielk1977 Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   
    20     20   /*
    21     21   ** Delete all the content of a Select structure but do not deallocate
    22     22   ** the select structure itself.
................................................................................
  2443   2443   **     End: ...
  2444   2444   **
  2445   2445   ** We call AltB, AeqB, AgtB, EofA, and EofB "subroutines" but they are not
  2446   2446   ** actually called using Gosub and they do not Return.  EofA and EofB loop
  2447   2447   ** until all data is exhausted then jump to the "end" labe.  AltB, AeqB,
  2448   2448   ** and AgtB jump to either L2 or to one of EofA or EofB.
  2449   2449   */
         2450  +#ifndef SQLITE_OMIT_COMPOUND_SELECT
  2450   2451   static int multiSelectOrderBy(
  2451   2452     Parse *pParse,        /* Parsing context */
  2452   2453     Select *p,            /* The right-most of SELECTs to be coded */
  2453   2454     SelectDest *pDest     /* What to do with query results */
  2454   2455   ){
  2455   2456     int i, j;             /* Loop counters */
  2456   2457     Select *pPrior;       /* Another SELECT immediately to our left */
................................................................................
  2789   2790     }
  2790   2791     p->pPrior = pPrior;
  2791   2792   
  2792   2793     /*** TBD:  Insert subroutine calls to close cursors on incomplete
  2793   2794     **** subqueries ****/
  2794   2795     return SQLITE_OK;
  2795   2796   }
         2797  +#endif
  2796   2798   
  2797   2799   #if !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW)
  2798   2800   /* Forward Declarations */
  2799   2801   static void substExprList(sqlite3*, ExprList*, int, ExprList*);
  2800   2802   static void substSelect(sqlite3*, Select *, int, ExprList *);
  2801   2803   
  2802   2804   /*

Changes to test/cse.test.

     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12     12   # Test cases designed to exercise and verify the logic for
    13     13   # factoring constant expressions out of loops and for
    14     14   # common subexpression eliminations.
    15     15   #
    16         -# $Id: cse.test,v 1.5 2008/04/01 18:04:11 drh Exp $
           16  +# $Id: cse.test,v 1.6 2008/08/04 03:51:24 danielk1977 Exp $
    17     17   #
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   source $testdir/tester.tcl
    21     21   
    22     22   do_test cse-1.1 {
    23     23     execsql {
................................................................................
    90     90     }
    91     91   } {0 -12 1 11 0 -22 1 21}
    92     92   do_test cse-1.10 {
    93     93     execsql {
    94     94       SELECT CAST(b AS integer), typeof(b), CAST(b AS text), typeof(b) FROM t1
    95     95     }
    96     96   } {11 integer 11 integer 21 integer 21 integer}
    97         -do_test cse-1.11 { 
    98         -  execsql {
    99         -    SELECT *,* FROM t1 WHERE a=2
   100         -    UNION ALL
   101         -    SELECT *,* FROM t1 WHERE a=1
   102         -  }
   103         -} {2 21 22 23 24 25 2 21 22 23 24 25 1 11 12 13 14 15 1 11 12 13 14 15}
   104         -do_test cse-1.12 { 
   105         -  execsql {
   106         -    SELECT coalesce(b,c,d,e), a, b, c, d, e FROM t1 WHERE a=2
   107         -    UNION ALL
   108         -    SELECT coalesce(e,d,c,b), e, d, c, b, a FROM t1 WHERE a=1
   109         -  }
   110         -} {21 2 21 22 23 24 14 14 13 12 11 1}
           97  +ifcapable compound {
           98  +  do_test cse-1.11 { 
           99  +    execsql {
          100  +      SELECT *,* FROM t1 WHERE a=2
          101  +      UNION ALL
          102  +      SELECT *,* FROM t1 WHERE a=1
          103  +    }
          104  +  } {2 21 22 23 24 25 2 21 22 23 24 25 1 11 12 13 14 15 1 11 12 13 14 15}
          105  +  do_test cse-1.12 { 
          106  +    execsql {
          107  +      SELECT coalesce(b,c,d,e), a, b, c, d, e FROM t1 WHERE a=2
          108  +      UNION ALL
          109  +      SELECT coalesce(e,d,c,b), e, d, c, b, a FROM t1 WHERE a=1
          110  +    }
          111  +  } {21 2 21 22 23 24 14 14 13 12 11 1}
          112  +}
   111    113   do_test cse-1.13 {
   112    114     execsql {
   113    115        SELECT upper(b), typeof(b), b FROM t1
   114    116     }
   115    117   } {11 integer 11 21 integer 21}
   116    118   do_test cse-1.14 {
   117    119     execsql {

Changes to test/func.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 built-in functions.
    13     13   #
    14         -# $Id: func.test,v 1.85 2008/07/31 01:47:11 shane Exp $
           14  +# $Id: func.test,v 1.86 2008/08/04 03:51:24 danielk1977 Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   # Create a table to work with.
    20     20   #
    21     21   do_test func-0.0 {
................................................................................
   286    286     } {z+1abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP}
   287    287   }
   288    288   do_test func-8.4 {
   289    289     execsql {
   290    290       SELECT max('z+'||a||'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP') FROM t3;
   291    291     }
   292    292   } {z+67890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP}
   293         -do_test func-8.5 {
   294         -  execsql {
   295         -    SELECT sum(x) FROM (SELECT '9223372036' || '854775807' AS x
   296         -                        UNION ALL SELECT -9223372036854775807)
   297         -  }
   298         -} {0}
   299         -do_test func-8.6 {
   300         -  execsql {
   301         -    SELECT typeof(sum(x)) FROM (SELECT '9223372036' || '854775807' AS x
   302         -                        UNION ALL SELECT -9223372036854775807)
   303         -  }
   304         -} {integer}
   305         -do_test func-8.7 {
   306         -  execsql {
   307         -    SELECT typeof(sum(x)) FROM (SELECT '9223372036' || '854775808' AS x
   308         -                        UNION ALL SELECT -9223372036854775807)
   309         -  }
   310         -} {real}
   311         -do_test func-8.8 {
   312         -  execsql {
   313         -    SELECT sum(x)>0.0 FROM (SELECT '9223372036' || '854775808' AS x
   314         -                        UNION ALL SELECT -9223372036850000000)
   315         -  }
   316         -} {1}
          293  +ifcapable compound {
          294  +  do_test func-8.5 {
          295  +    execsql {
          296  +      SELECT sum(x) FROM (SELECT '9223372036' || '854775807' AS x
          297  +                          UNION ALL SELECT -9223372036854775807)
          298  +    }
          299  +  } {0}
          300  +  do_test func-8.6 {
          301  +    execsql {
          302  +      SELECT typeof(sum(x)) FROM (SELECT '9223372036' || '854775807' AS x
          303  +                          UNION ALL SELECT -9223372036854775807)
          304  +    }
          305  +  } {integer}
          306  +  do_test func-8.7 {
          307  +    execsql {
          308  +      SELECT typeof(sum(x)) FROM (SELECT '9223372036' || '854775808' AS x
          309  +                          UNION ALL SELECT -9223372036854775807)
          310  +    }
          311  +  } {real}
          312  +  do_test func-8.8 {
          313  +    execsql {
          314  +      SELECT sum(x)>0.0 FROM (SELECT '9223372036' || '854775808' AS x
          315  +                          UNION ALL SELECT -9223372036850000000)
          316  +    }
          317  +  } {1}
          318  +}
   317    319   
   318    320   # How do you test the random() function in a meaningful, deterministic way?
   319    321   #
   320    322   do_test func-9.1 {
   321    323     execsql {
   322    324       SELECT random() is not null;
   323    325     }

Changes to test/in.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 IN and BETWEEN operator.
    13     13   #
    14         -# $Id: in.test,v 1.21 2008/06/26 18:04:03 danielk1977 Exp $
           14  +# $Id: in.test,v 1.22 2008/08/04 03:51:24 danielk1977 Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   # Generate the test data we will need for the first squences of tests.
    20     20   #
    21     21   do_test in-1.0 {
................................................................................
   362    362     execsql {
   363    363       SELECT * FROM t6 WHERE +a IN ('2');
   364    364     }
   365    365   } {}
   366    366   
   367    367   # Test error conditions with expressions of the form IN(<compound select>).
   368    368   #
          369  +ifcapable compound {
   369    370   do_test in-12.1 {
   370    371     execsql {
   371    372       CREATE TABLE t2(a, b, c);
   372    373       CREATE TABLE t3(a, b, c);
   373    374     }
   374    375   } {}
   375    376   do_test in-12.2 {
................................................................................
   424    425   do_test in-12.9 {
   425    426     catchsql {
   426    427       SELECT * FROM t2 WHERE a IN (
   427    428         SELECT a FROM t3 INTERSECT SELECT a, b FROM t2
   428    429       );
   429    430     }
   430    431   } {1 {SELECTs to the left and right of INTERSECT do not have the same number of result columns}}
          432  +}
   431    433   
   432    434   
   433    435   #------------------------------------------------------------------------
   434    436   # The following tests check that NULL is handled correctly when it 
   435    437   # appears as part of a set of values on the right-hand side of an
   436    438   # IN or NOT IN operator.
   437    439   #

Changes to test/in3.test.

     9      9   #
    10     10   #***********************************************************************
    11     11   # This file tests the optimisations made in November 2007 of expressions 
    12     12   # of the following form:
    13     13   #
    14     14   #     <value> IN (SELECT <column> FROM <table>)
    15     15   #
    16         -# $Id: in3.test,v 1.4 2008/03/12 10:39:00 danielk1977 Exp $
           16  +# $Id: in3.test,v 1.5 2008/08/04 03:51:24 danielk1977 Exp $
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
    20     20   
    21     21   ifcapable !subquery {
    22     22     finish_test
    23     23     return
................................................................................
    99     99     exec_neph {
   100    100       SELECT a FROM t1 WHERE a IN (SELECT a FROM t1 ORDER BY a LIMIT 1 OFFSET 1)
   101    101     }
   102    102   } {1 3}
   103    103   
   104    104   # Has to use a temp-table because of the compound sub-select.
   105    105   #
   106         -do_test in3-1.13 {
   107         -  exec_neph {
   108         -    SELECT a FROM t1 WHERE a IN (
   109         -      SELECT a FROM t1 UNION ALL SELECT a FROM t1
   110         -    )
   111         -  }
   112         -} {1 1 3 5}
          106  +ifcapable compound {
          107  +  do_test in3-1.13 {
          108  +    exec_neph {
          109  +      SELECT a FROM t1 WHERE a IN (
          110  +        SELECT a FROM t1 UNION ALL SELECT a FROM t1
          111  +      )
          112  +    }
          113  +  } {1 1 3 5}
          114  +}
   113    115   
   114    116   # The first of these queries has to use the temp-table, because the 
   115    117   # collation sequence used for the index on "t1.a" does not match the
   116    118   # collation sequence used by the "IN" comparison. The second does not
   117    119   # require a temp-table, because the collation sequences match.
   118    120   #
   119    121   do_test in3-1.14 {

Changes to test/insert5.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12     12   # The tests in this file ensure that a temporary table is used
    13     13   # when required by an "INSERT INTO ... SELECT ..." statement.
    14     14   #
    15         -# $Id: insert5.test,v 1.4 2008/01/06 00:25:22 drh Exp $
           15  +# $Id: insert5.test,v 1.5 2008/08/04 03:51:24 danielk1977 Exp $
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   ifcapable !subquery {
    21     21     finish_test
    22     22     return
................................................................................
    43     43       INSERT INTO MAIN(Id,Id1) VALUES(2,3); 
    44     44       INSERT INTO B(Id,Id1) VALUES(2,3); 
    45     45     }
    46     46   } {}
    47     47   
    48     48   # Run the query.
    49     49   #
    50         -do_test insert5-1.1 {
    51         -  execsql {
    52         -    INSERT INTO B 
    53         -      SELECT * FROM B UNION ALL 
    54         -      SELECT * FROM MAIN WHERE exists (select * FROM B WHERE B.Id = MAIN.Id);
           50  +ifcapable compound {
           51  +  do_test insert5-1.1 {
           52  +    execsql {
           53  +      INSERT INTO B 
           54  +        SELECT * FROM B UNION ALL 
           55  +        SELECT * FROM MAIN WHERE exists (select * FROM B WHERE B.Id = MAIN.Id);
           56  +      SELECT * FROM B;
           57  +    }
           58  +  } {2 3 2 3 2 3}
           59  +} else {
           60  +  do_test insert5-1.1 {
           61  +    execsql {
           62  +      INSERT INTO B SELECT * FROM B;
           63  +      INSERT INTO B
           64  +        SELECT * FROM MAIN WHERE exists (select * FROM B WHERE B.Id = MAIN.Id);
    55     65         SELECT * FROM B;
    56         -  }
    57         -} {2 3 2 3 2 3}
           66  +    }
           67  +  } {2 3 2 3 2 3}
           68  +}
    58     69   do_test insert5-2.1 {
    59     70     uses_temp_table { INSERT INTO b SELECT * FROM main }
    60     71   } {0}
    61     72   do_test insert5-2.2 {
    62     73     uses_temp_table { INSERT INTO b SELECT * FROM b }
    63     74   } {1}
    64     75   do_test insert5-2.3 {

Changes to test/select1.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: select1.test,v 1.64 2008/07/15 00:27:35 drh Exp $
           14  +# $Id: select1.test,v 1.65 2008/08/04 03:51:24 danielk1977 Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   # Try to select on a non-existant table.
    20     20   #
    21     21   do_test select1-1.1 {
................................................................................
   624    624       SELECT f1 FROM test1 UNION SELECT f2+100 FROM test1
   625    625       ORDER BY f2+101;
   626    626     }} msg]
   627    627     lappend v $msg
   628    628   } {1 {1st ORDER BY term does not match any column in the result set}}
   629    629   
   630    630   # Ticket #2296
   631         -ifcapable subquery {
          631  +ifcapable subquery&&compound {
   632    632   do_test select1-6.20 {
   633    633      execsql {
   634    634        CREATE TABLE t6(a TEXT, b TEXT);
   635    635        INSERT INTO t6 VALUES('a','0');
   636    636        INSERT INTO t6 VALUES('b','1');
   637    637        INSERT INTO t6 VALUES('c','2');
   638    638        INSERT INTO t6 VALUES('d','3');

Changes to test/select4.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 UNION, INTERSECT and EXCEPT operators
    13     13   # in SELECT statements.
    14     14   #
    15         -# $Id: select4.test,v 1.28 2008/06/25 08:02:44 mihailim Exp $
           15  +# $Id: select4.test,v 1.29 2008/08/04 03:51:24 danielk1977 Exp $
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   # Most tests in this file depend on compound-select. But there are a couple
    21     21   # right at the end that test DISTINCT, so we cannot omit the entire file.
    22     22   #
................................................................................
   612    612     execsql2 {
   613    613       SELECT * FROM (SELECT 1 AS a, 2 AS b UNION ALL SELECT 3 AS e, 4 AS b)
   614    614        WHERE b>0
   615    615     }
   616    616   } {a 1 b 2 a 3 b 4}
   617    617   } ;# ifcapable subquery
   618    618   
   619         -} ;# ifcapable compound
   620         -
   621    619   # Try combining DISTINCT, LIMIT, and OFFSET.  Make sure they all work
   622    620   # together.
   623    621   #
   624    622   do_test select4-10.1 {
   625    623     execsql {
   626    624       SELECT DISTINCT log FROM t1 ORDER BY log
   627    625     }
................................................................................
   788    786       SELECT x FROM t2
   789    787       UNION ALL
   790    788       SELECT x FROM t2
   791    789       EXCEPT
   792    790       SELECT x FROM t2
   793    791     }
   794    792   } {1 {SELECTs to the left and right of UNION do not have the same number of result columns}}
          793  +
          794  +} ;# ifcapable compound
   795    795   
   796    796   finish_test

Changes to test/selectA.test.

    13     13   # The focus of this file is testing the compound-SELECT merge
    14     14   # optimization.  Or, in other words, making sure that all
    15     15   # possible combinations of UNION, UNION ALL, EXCEPT, and
    16     16   # INTERSECT work together with an ORDER BY clause (with or w/o
    17     17   # explicit sort order and explicit collating secquites) and
    18     18   # with and without optional LIMIT and OFFSET clauses.
    19     19   #
    20         -# $Id: selectA.test,v 1.4 2008/07/15 00:27:35 drh Exp $
           20  +# $Id: selectA.test,v 1.5 2008/08/04 03:51:24 danielk1977 Exp $
    21     21   
    22     22   set testdir [file dirname $argv0]
    23     23   source $testdir/tester.tcl
           24  +
           25  +ifcapable !compound {
           26  +  finish_test
           27  +  return
           28  +}
    24     29   
    25     30   do_test selectA-1.0 {
    26     31     execsql {
    27     32       CREATE TABLE t1(a,b,c COLLATE NOCASE);
    28     33       INSERT INTO t1 VALUES(1,'a','a');
    29     34       INSERT INTO t1 VALUES(9.9, 'b', 'B');
    30     35       INSERT INTO t1 VALUES(NULL, 'C', 'c');

Changes to test/selectB.test.

     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   # This file implements regression tests for SQLite library. 
    12     12   #
    13         -# $Id: selectB.test,v 1.8 2008/07/12 14:52:20 drh Exp $
           13  +# $Id: selectB.test,v 1.9 2008/08/04 03:51:24 danielk1977 Exp $
    14     14   
    15     15   set testdir [file dirname $argv0]
    16     16   source $testdir/tester.tcl
           17  +
           18  +ifcapable !compound {
           19  +  finish_test
           20  +  return
           21  +}
    17     22   
    18     23   proc test_transform {testname sql1 sql2 results} {
    19     24     set ::vdbe1 [list]
    20     25     set ::vdbe2 [list]
    21     26     db eval "explain $sql1" { lappend ::vdbe1 $opcode }
    22     27     db eval "explain $sql2" { lappend ::vdbe2 $opcode }
    23     28   

Changes to test/shared4.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   #
    12     12   # Test the btree mutex protocol for shared cache mode.
    13     13   #
    14         -# $Id: shared4.test,v 1.1 2008/07/14 19:39:17 drh Exp $
           14  +# $Id: shared4.test,v 1.2 2008/08/04 03:51:24 danielk1977 Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   db close
    19     19   puts hello
    20     20   
    21     21   # This script is only valid if we are running shared-cache mode in a
    22     22   # threadsafe-capable database engine.
    23     23   #
    24         -ifcapable !shared_cache {
           24  +ifcapable !shared_cache||!compound {
    25     25     finish_test
    26     26     return
    27     27   }
    28     28   set ::enable_shared_cache [sqlite3_enable_shared_cache 1]
    29     29   
    30     30   # Prepare multiple databases in shared cache mode.
    31     31   #

Changes to test/sidedelete.test.

    11     11   #
    12     12   # This file contains test cases for stressing database
    13     13   # changes that involve side effects that delete rows from
    14     14   # the table being changed.  Ticket #2832 shows that in
    15     15   # older versions of SQLite that behavior was implemented
    16     16   # incorrectly and resulted in corrupt database files.
    17     17   #
    18         -# $Id: sidedelete.test,v 1.1 2007/12/12 22:24:13 drh Exp $
           18  +# $Id: sidedelete.test,v 1.2 2008/08/04 03:51:24 danielk1977 Exp $
    19     19   #
    20     20   
    21     21   set testdir [file dirname $argv0]
    22     22   source $testdir/tester.tcl
    23     23   
    24     24   # The sequence table is created to store a sequence of integers
    25     25   # starting with 1.  This is used to reinitialize other tables
................................................................................
    43     43   # correlated subquery.  This would cause database corruption
    44     44   # prior to the fix for ticket #2832.
    45     45   #
    46     46   do_test sidedelete-2.0 {
    47     47     execsql {
    48     48       CREATE TABLE t1(a PRIMARY KEY, b);
    49     49       CREATE TABLE chng(a PRIMARY KEY, b);
    50         -    SELECT count(*) FROM t1 UNION ALL SELECT count(*) FROM chng;
           50  +    SELECT count(*) FROM t1;
           51  +    SELECT count(*) FROM chng;
    51     52     }
    52     53   } {0 0}
    53     54   for {set i 2} {$i<=100} {incr i} {
    54     55     set n [expr {($i+2)/2}]
    55     56     do_test sidedelete-2.$i.1 {
    56     57       execsql {
    57     58         DELETE FROM t1;

Changes to test/subselect.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 SELECT statements that are part of
    13     13   # expressions.
    14     14   #
    15         -# $Id: subselect.test,v 1.15 2008/07/15 00:27:35 drh Exp $
           15  +# $Id: subselect.test,v 1.16 2008/08/04 03:51:24 danielk1977 Exp $
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   # Omit this whole file if the library is build without subquery support.
    21     21   ifcapable !subquery {
    22     22     finish_test
................................................................................
    52     52   } {4}
    53     53   do_test subselect-1.3c {
    54     54     execsql {SELECT b from t1 where a = (SELECT a FROM t1 WHERE b=6)}
    55     55   } {6}
    56     56   do_test subselect-1.3d {
    57     57     execsql {SELECT b from t1 where a = (SELECT a FROM t1 WHERE b=8)}
    58     58   } {}
    59         -do_test subselect-1.3e {
    60         -  execsql {
    61         -    SELECT b FROM t1
    62         -     WHERE a = (SELECT a FROM t1 UNION SELECT b FROM t1 ORDER BY 1);
    63         -  }
    64         -} {2}
           59  +ifcapable compound {
           60  +  do_test subselect-1.3e {
           61  +    execsql {
           62  +      SELECT b FROM t1
           63  +       WHERE a = (SELECT a FROM t1 UNION SELECT b FROM t1 ORDER BY 1);
           64  +    }
           65  +  } {2}
           66  +}
    65     67   
    66     68   # What if the subselect doesn't return any value.  We should get
    67     69   # NULL as the result.  Check it out.
    68     70   #
    69     71   do_test subselect-1.4 {
    70     72     execsql {SELECT b from t1 where a = coalesce((SELECT a FROM t1 WHERE b=5),1)}
    71     73   } {2}

Changes to test/tkt2192.test.

    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library.
    12     12   #
    13     13   # This file implements tests to verify that ticket #2192 has been
    14     14   # fixed.  
    15     15   #
    16     16   #
    17         -# $Id: tkt2192.test,v 1.2 2007/09/12 17:01:45 danielk1977 Exp $
           17  +# $Id: tkt2192.test,v 1.3 2008/08/04 03:51:24 danielk1977 Exp $
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   source $testdir/tester.tcl
    21     21   
    22         -ifcapable !datetime {
           22  +ifcapable !datetime||!compound {
    23     23     finish_test
    24     24     return
    25     25   }
    26     26   
    27         -do_test tkt2191-1.1 {
           27  +do_test tkt2192-1.1 {
    28     28     execsql {
    29     29       -- Raw data (RBS) --------
    30     30       
    31     31       create table records (
    32     32         date          real,
    33     33         type          text,
    34     34         description   text,

Changes to test/tkt2640.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   #
    12     12   # This file is to test that ticket #2640 has been fixed.
    13     13   #
    14         -# $Id: tkt2640.test,v 1.2 2007/12/10 05:03:48 danielk1977 Exp $
           14  +# $Id: tkt2640.test,v 1.3 2008/08/04 03:51:24 danielk1977 Exp $
    15     15   #
    16     16   
    17     17   # The problem in ticket #2640 was that the query optimizer was 
    18     18   # not recognizing all uses of tables within subqueries in the
    19     19   # WHERE clause.  If the subquery contained a compound SELECT,
    20     20   # then tables that were used by terms of the compound other than
    21     21   # the last term would not be recognized as dependencies.
................................................................................
    24     24   # optimizer would not recognize this and would try to evaluate
    25     25   # the subquery too early, before that tables value had been
    26     26   # established.
    27     27   
    28     28   set testdir [file dirname $argv0]
    29     29   source $testdir/tester.tcl
    30     30   
    31         -ifcapable !subquery {
           31  +ifcapable !subquery||!compound {
    32     32     finish_test
    33     33     return
    34     34   }
    35     35   
    36     36   do_test tkt2640-1.1 {
    37     37     execsql {
    38     38       CREATE TABLE persons(person_id, name);

Changes to test/tkt2822.test.

     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12     12   # This file is to test that the issues surrounding expressions in
    13     13   # ORDER BY clauses on compound SELECT statements raised by ticket
    14     14   # #2822 have been dealt with.
    15     15   #
    16         -# $Id: tkt2822.test,v 1.4 2007/12/13 17:50:23 drh Exp $
           16  +# $Id: tkt2822.test,v 1.5 2008/08/04 03:51:24 danielk1977 Exp $
    17     17   #
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   source $testdir/tester.tcl
           21  +
           22  +ifcapable !compound {
           23  +  finish_test
           24  +  return
           25  +}
    21     26   
    22     27   # The ORDER BY matching algorithm is three steps:
    23     28   # 
    24     29   #   (1)  If the ORDER BY term is an integer constant i, then
    25     30   #        sort by the i-th column of the result set.
    26     31   # 
    27     32   #   (2)  If the ORDER BY term is an identifier (not x.y or x.y.z

Changes to test/tkt2927.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   #
    12     12   # This file is to test that ticket #2927 is fixed.
    13     13   #
    14         -# $Id: tkt2927.test,v 1.3 2008/07/12 14:52:21 drh Exp $
           14  +# $Id: tkt2927.test,v 1.4 2008/08/04 03:51:24 danielk1977 Exp $
    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   # Create a database.
    21     26   #
    22     27   do_test tkt2927-1.1 {
    23     28     db eval {
    24     29       CREATE TABLE t1(a, b);
    25     30       INSERT INTO t1 VALUES(1,11);

Changes to test/trigger9.test.

   185    185           INSERT INTO t2 VALUES(old.a);
   186    186         END;
   187    187         UPDATE v1 SET b = 'hello';
   188    188         SELECT * FROM t2;
   189    189       ROLLBACK;
   190    190     }
   191    191   } {1 2 3 3}
   192         -do_test trigger9-3.5 {
   193         -  execsql {
   194         -    BEGIN;
   195         -      INSERT INTO t3 VALUES(1, 'uno');
   196         -      CREATE VIEW v1 AS SELECT a, b FROM t3 EXCEPT SELECT 1, 'one';
   197         -      CREATE TRIGGER trig1 INSTEAD OF UPDATE ON v1 BEGIN
   198         -        INSERT INTO t2 VALUES(old.a);
   199         -      END;
   200         -      UPDATE v1 SET b = 'hello';
   201         -      SELECT * FROM t2;
   202         -    ROLLBACK;
   203         -  }
   204         -} {1 2 3}
   205         -do_test trigger9-3.6 {
   206         -  execsql {
   207         -    BEGIN;
   208         -      INSERT INTO t3 VALUES(1, 'zero');
   209         -      CREATE VIEW v1 AS 
   210         -        SELECT sum(a) AS a, max(b) AS b FROM t3 GROUP BY t3.a HAVING b>'two';
   211         -      CREATE TRIGGER trig1 INSTEAD OF UPDATE ON v1 BEGIN
   212         -        INSERT INTO t2 VALUES(old.a);
   213         -      END;
   214         -      UPDATE v1 SET b = 'hello';
   215         -      SELECT * FROM t2;
   216         -    ROLLBACK;
   217         -  }
   218         -} {2}
          192  +
          193  +ifcapable compound {
          194  +  do_test trigger9-3.5 {
          195  +    execsql {
          196  +      BEGIN;
          197  +        INSERT INTO t3 VALUES(1, 'uno');
          198  +        CREATE VIEW v1 AS SELECT a, b FROM t3 EXCEPT SELECT 1, 'one';
          199  +        CREATE TRIGGER trig1 INSTEAD OF UPDATE ON v1 BEGIN
          200  +          INSERT INTO t2 VALUES(old.a);
          201  +        END;
          202  +        UPDATE v1 SET b = 'hello';
          203  +        SELECT * FROM t2;
          204  +      ROLLBACK;
          205  +    }
          206  +  } {1 2 3}
          207  +  do_test trigger9-3.6 {
          208  +    execsql {
          209  +      BEGIN;
          210  +        INSERT INTO t3 VALUES(1, 'zero');
          211  +        CREATE VIEW v1 AS 
          212  +          SELECT sum(a) AS a, max(b) AS b FROM t3 GROUP BY t3.a HAVING b>'two';
          213  +        CREATE TRIGGER trig1 INSTEAD OF UPDATE ON v1 BEGIN
          214  +          INSERT INTO t2 VALUES(old.a);
          215  +        END;
          216  +        UPDATE v1 SET b = 'hello';
          217  +        SELECT * FROM t2;
          218  +      ROLLBACK;
          219  +    }
          220  +  } {2}
          221  +}
   219    222   
   220    223   finish_test

Changes to test/triggerA.test.

    15     15   # into the query that manifests the view?
    16     16   #
    17     17   # Ticket #2938
    18     18   #
    19     19   
    20     20   set testdir [file dirname $argv0]
    21     21   source $testdir/tester.tcl
    22         -ifcapable {!trigger} {
           22  +ifcapable !trigger||!compound {
    23     23     finish_test
    24     24     return
    25     25   }
    26     26   
    27     27   # Create two table containing some sample data
    28     28   #
    29     29   do_test triggerA-1.1 {

Changes to tool/omittest.tcl.

     1      1   
     2         -set rcsid {$Id: omittest.tcl,v 1.5 2008/07/31 02:43:35 shane Exp $}
            2  +set rcsid {$Id: omittest.tcl,v 1.6 2008/08/04 03:51:24 danielk1977 Exp $}
     3      3   
     4      4   # Documentation for this script. This may be output to stderr
     5      5   # if the script is invoked incorrectly.
     6      6   set ::USAGE_MESSAGE {
     7      7   This Tcl script is used to test the various compile time options 
     8      8   available for omitting code (the SQLITE_OMIT_xxx options). It
     9      9   should be invoked as follows:
................................................................................
    58     58     }
    59     59   
    60     60     # Create the directory and do the build. If an error occurs return
    61     61     # early without attempting to run the test suite.
    62     62     file mkdir $dir
    63     63     puts -nonewline "Building $dir..."
    64     64     flush stdout
           65  +catch {
    65     66     file copy -force ./config.h $dir
    66     67     file copy -force ./libtool $dir
           68  +}
    67     69     set rc [catch {
    68     70       exec make -C $dir -f $::MAKEFILE testfixture OPTS=$opts >& $dir/build.log
    69     71     }]
    70     72     if {$rc} {
    71     73       puts "No good. See $dir/build.log."
    72     74       return
    73     75     } else {