/ Check-in [5f80140a]
Login

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

Overview
Comment:The fix in (6111) was not quite right. This version works better. (CVS 6113)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5f80140a2df48fd43a7cbc0990de0205004541b0
User & Date: drh 2009-01-05 22:30:39
Context
2009-01-06
00:08
Fix a problem in the WHERE clause generator when the FROM clause is empty. (CVS 6114) check-in: a7015625 user: drh tags: trunk
2009-01-05
22:30
The fix in (6111) was not quite right. This version works better. (CVS 6113) check-in: 5f80140a user: drh tags: trunk
19:36
Reenable fuzz testing for all.test. Make sure the query flattener copies over aggregate information from expressions on outer query terms while flattening. (CVS 6112) check-in: e02323b3 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

    39     39   **
    40     40   ** Various scripts scan this source file in order to generate HTML
    41     41   ** documentation, headers files, or other derived files.  The formatting
    42     42   ** of the code in this file is, therefore, important.  See other comments
    43     43   ** in this file for details.  If in doubt, do not deviate from existing
    44     44   ** commenting and indentation practices when changing or adding code.
    45     45   **
    46         -** $Id: vdbe.c,v 1.809 2009/01/05 18:02:27 drh Exp $
           46  +** $Id: vdbe.c,v 1.810 2009/01/05 22:30:39 drh Exp $
    47     47   */
    48     48   #include "sqliteInt.h"
    49     49   #include <ctype.h>
    50     50   #include "vdbeInt.h"
    51     51   
    52     52   /*
    53     53   ** The following global variable is incremented every time a cursor
................................................................................
  1518   1518   ** A NULL value is not changed by this routine.  It remains NULL.
  1519   1519   */
  1520   1520   case OP_ToBlob: {                  /* same as TK_TO_BLOB, in1 */
  1521   1521     if( pIn1->flags & MEM_Null ) break;
  1522   1522     if( (pIn1->flags & MEM_Blob)==0 ){
  1523   1523       applyAffinity(pIn1, SQLITE_AFF_TEXT, encoding);
  1524   1524       assert( pIn1->flags & MEM_Str || db->mallocFailed );
         1525  +    MemSetTypeFlag(pIn1, MEM_Blob);
         1526  +  }else{
         1527  +    pIn1->flags &= ~(MEM_TypeMask&~MEM_Blob);
  1525   1528     }
  1526         -  MemSetTypeFlag(pIn1, MEM_Blob);
  1527   1529     UPDATE_MAX_BLOBSIZE(pIn1);
  1528   1530     break;
  1529   1531   }
  1530   1532   
  1531   1533   /* Opcode: ToNumeric P1 * * * *
  1532   1534   **
  1533   1535   ** Force the value in register P1 to be numeric (either an

Changes to src/vdbemem.c.

    11     11   *************************************************************************
    12     12   **
    13     13   ** This file contains code use to manipulate "Mem" structure.  A "Mem"
    14     14   ** stores a single value in the VDBE.  Mem is an opaque structure visible
    15     15   ** only within the VDBE.  Interface routines refer to a Mem using the
    16     16   ** name sqlite_value
    17     17   **
    18         -** $Id: vdbemem.c,v 1.133 2008/12/10 19:26:24 drh Exp $
           18  +** $Id: vdbemem.c,v 1.134 2009/01/05 22:30:39 drh Exp $
    19     19   */
    20     20   #include "sqliteInt.h"
    21     21   #include <ctype.h>
    22     22   #include "vdbeInt.h"
    23     23   
    24     24   /*
    25     25   ** Call sqlite3VdbeMemExpandBlob() on the supplied value (type Mem*)
................................................................................
   460    460   
   461    461   /*
   462    462   ** Delete any previous value and set the value to be a BLOB of length
   463    463   ** n containing all zeros.
   464    464   */
   465    465   void sqlite3VdbeMemSetZeroBlob(Mem *pMem, int n){
   466    466     sqlite3VdbeMemRelease(pMem);
   467         -  MemSetTypeFlag(pMem, MEM_Blob);
   468    467     pMem->flags = MEM_Blob|MEM_Zero;
   469    468     pMem->type = SQLITE_BLOB;
   470    469     pMem->n = 0;
   471    470     if( n<0 ) n = 0;
   472    471     pMem->u.nZero = n;
   473    472     pMem->enc = SQLITE_UTF8;
   474    473   }

Changes to test/fuzz.test.

    15     15   #
    16     16   # The tests in this file are really about testing fuzzily generated
    17     17   # SQL parse-trees. The majority of the fuzzily generated SQL is 
    18     18   # valid as far as the parser is concerned. 
    19     19   #
    20     20   # The most complicated trees are for SELECT statements.
    21     21   #
    22         -# $Id: fuzz.test,v 1.15 2009/01/05 19:36:30 drh Exp $
           22  +# $Id: fuzz.test,v 1.16 2009/01/05 22:30:39 drh Exp $
    23     23   
    24     24   set testdir [file dirname $argv0]
    25     25   source $testdir/tester.tcl
    26     26   
    27     27   set ::REPEATS 5000
    28     28   
    29     29   # If running quick.test, don't do so many iterations.
................................................................................
   244    244   } {0 {}}
   245    245   do_test fuzz-1.16.4 {
   246    246     execsql {
   247    247       DROP TABLE abc; DROP TABLE def; DROP TABLE ghi;
   248    248     }
   249    249   } {}
   250    250   
          251  +do_test fuzz-1.17 {
          252  +  catchsql {
          253  +    SELECT 'hardware', 56.1 NOTNULL, random()&0
          254  +    FROM (
          255  +       SELECT ALL lower(~ EXISTS (
          256  +           SELECT 1 NOT IN (SELECT ALL 1)
          257  +       )), CAST(456 AS integer), -2147483647
          258  +       FROM (
          259  +         SELECT DISTINCT -456, CAST(1 AS integer) ISNULL
          260  +         FROM (SELECT ALL 2147483647, typeof(2147483649))
          261  +       )
          262  +    )
          263  +    GROUP BY CAST(CAST('experiments' AS blob) AS blob)
          264  +    HAVING random()
          265  +  }
          266  +} {0 {hardware 1 0}}
          267  +
   251    268   #----------------------------------------------------------------
   252    269   # Test some fuzzily generated expressions.
   253    270   #
   254    271   do_fuzzy_test fuzz-2 -template  { SELECT [Expr] }
   255    272   
   256    273   do_test fuzz-3.1 {
   257    274     execsql {