/ Check-in [a835658e]
Login

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

Overview
Comment:2.0.7 (CVS 292)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a835658e507fc7d0c684959c0f0afb9018b6a8d4
User & Date: drh 2001-10-20 12:30:11
Context
2001-10-22
02:58
More changes for 2.0.7. (CVS 293) check-in: f8328a5f user: drh tags: trunk
2001-10-20
12:30
2.0.7 (CVS 292) check-in: a835658e user: drh tags: trunk
2001-10-19
16:45
Version 2.0.6 (CVS 464) check-in: c8535a0d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to VERSION.

     1         -2.0.6
            1  +2.0.7

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.42 2001/10/19 16:44:57 drh Exp $
           15  +** $Id: select.c,v 1.43 2001/10/20 12:30:11 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   /*
    20     20   ** Allocate a new Select structure and return a pointer to that
    21     21   ** structure.
    22     22   */
................................................................................
   256    256       }else if( p->op==TK_COLUMN && pTabList ){
   257    257         if( pTabList->nId>1 || showFullNames ){
   258    258           char *zName = 0;
   259    259           Table *pTab = pTabList->a[p->iTable - pParse->nTab].pTab;
   260    260           char *zTab;
   261    261    
   262    262           zTab = pTabList->a[p->iTable - pParse->nTab].zAlias;
   263         -        if( zTab==0 ) zTab = pTab->zName;
          263  +        if( showFullNames || zTab==0 ) zTab = pTab->zName;
   264    264           sqliteSetString(&zName, zTab, ".", pTab->aCol[p->iColumn].zName, 0);
   265    265           sqliteVdbeAddOp(v, OP_ColumnName, i, 0);
   266    266           sqliteVdbeChangeP3(v, -1, zName, strlen(zName));
   267    267           sqliteFree(zName);
   268    268         }else{
   269    269           Table *pTab = pTabList->a[0].pTab;
   270    270           char *zName = pTab->aCol[p->iColumn].zName;

Changes to src/table.c.

    44     44     int i;
    45     45     char *z;
    46     46   
    47     47     /* Make sure there is enough space in p->azResult to hold everything
    48     48     ** we need to remember from this invocation of the callback.
    49     49     */
    50     50     if( p->nRow==0 && argv!=0 ){
    51         -    p->nColumn = nCol;
    52     51       need = nCol*2;
    53     52     }else{
    54     53       need = nCol;
    55     54     }
    56     55     if( p->nData + need >= p->nAlloc ){
    57     56       p->nAlloc = p->nAlloc*2 + need + 1;
    58     57       p->azResult = realloc( p->azResult, sizeof(char*)*p->nAlloc );
................................................................................
    62     61       }
    63     62     }
    64     63   
    65     64     /* If this is the first row, then generate an extra row containing
    66     65     ** the names of all columns.
    67     66     */
    68     67     if( p->nRow==0 ){
           68  +    p->nColumn = nCol;
    69     69       for(i=0; i<nCol; i++){
    70     70         if( colv[i]==0 ){
    71     71           z = 0;
    72     72         }else{
    73     73           z = malloc( strlen(colv[i])+1 );
    74     74           if( z==0 ){
    75     75             p->rc = SQLITE_NOMEM;

Changes to src/vdbe.c.

    26     26   ** type to the other occurs as necessary.
    27     27   ** 
    28     28   ** Most of the code in this file is taken up by the sqliteVdbeExec()
    29     29   ** function which does the work of interpreting a VDBE program.
    30     30   ** But other routines are also provided to help in building up
    31     31   ** a program instruction by instruction.
    32     32   **
    33         -** $Id: vdbe.c,v 1.87 2001/10/19 16:44:57 drh Exp $
           33  +** $Id: vdbe.c,v 1.88 2001/10/20 12:30:11 drh Exp $
    34     34   */
    35     35   #include "sqliteInt.h"
    36     36   #include <ctype.h>
    37     37   
    38     38   /*
    39     39   ** SQL is translated into a sequence of instructions to be
    40     40   ** executed by a virtual machine.  Each instruction is an instance
................................................................................
  1453   1453     if( nDigit<0 ) nDigit = 0;
  1454   1454     if( nDigit>30 ) nDigit = 30;
  1455   1455     v = aStack[tos].r;
  1456   1456     sprintf(zBuf, "%.*f", nDigit, v);
  1457   1457     POPSTACK;
  1458   1458     Release(p, nos);
  1459   1459     zStack[nos] = sqliteStrDup(zBuf);
  1460         -  aStack[nos].n = strlen(zStack[tos]) + 1;
         1460  +  aStack[nos].n = strlen(zStack[nos]) + 1;
  1461   1461     aStack[nos].flags = STK_Str | STK_Dyn;
  1462   1462     break;
  1463   1463   }
  1464   1464   
  1465   1465   /* Opcode: Max * * *
  1466   1466   **
  1467   1467   ** Pop the top two elements from the stack then push back the

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.5 2001/10/13 02:59:09 drh Exp $
           14  +# $Id: func.test,v 1.6 2001/10/20 12:30:12 drh 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 {
................................................................................
   154    154   do_test func-4.8 {
   155    155     catchsql {SELECT round(c) FROM t1 ORDER BY a}
   156    156   } {0 {3 -12346 -5}}
   157    157   do_test func-4.9 {
   158    158     catchsql {SELECT round(c,a) FROM t1 ORDER BY a}
   159    159   } {0 {3.0 -12345.68 -5.000}}
   160    160   do_test func-4.10 {
          161  +  catchsql {SELECT 'x' || round(c,a) || 'y' FROM t1 ORDER BY a}
          162  +} {0 {x3.0y x-12345.68y x-5.000y}}
          163  +do_test func-4.11 {
   161    164     catchsql {SELECT round() FROM t1 ORDER BY a}
   162    165   } {1 {too few arguments to function round()}}
   163    166   
   164    167   finish_test

Changes to test/tableapi.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 sqlite_exec_printf() and
    13     13   # sqlite_get_table_printf() APIs.
    14     14   #
    15         -# $Id: tableapi.test,v 1.3 2001/09/16 00:13:28 drh Exp $
           15  +# $Id: tableapi.test,v 1.4 2001/10/20 12:30:12 drh Exp $
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   do_test tableapi-1.0 {
    21     21     set ::dbx [sqlite_open testdb]
    22     22     catch {sqlite_exec_printf $::dbx {DROP TABLE xyz} {}}
................................................................................
    29     29   } {0 {}}
    30     30   do_test tableapi-1.2 {
    31     31     sqlite_exec_printf $::dbx {SELECT * FROM xyz} {}
    32     32   } {0 {a b 1 {Hi Y'all}}}
    33     33   
    34     34   do_test tableapi-2.1 {
    35     35     sqlite_get_table_printf $::dbx {
           36  +    BEGIN TRANSACTION;
    36     37       SELECT * FROM xyz WHERE b='%q'
    37     38     } {Hi Y'all}
    38     39   } {0 1 2 a b 1 {Hi Y'all}}
    39     40   do_test tableapi-2.2 {
    40     41     sqlite_get_table_printf $::dbx {
    41     42       SELECT * FROM xyz
    42     43     } {}
................................................................................
    75     76     sqlite_get_table_printf $::dbx {
    76     77       INSERT INTO xyz VALUES(52,NULL)
    77     78     } {}
    78     79     sqlite_get_table_printf $::dbx {
    79     80       SELECT * FROM xyz WHERE a IN (42,50,52) ORDER BY a DESC
    80     81     } {}
    81     82   } {0 3 2 a b 52 NULL 50 (50) 42 (42)}
           83  +do_test tableapi-2.7 {
           84  +  sqlite_get_table_printf $::dbx {
           85  +    SELECT * FROM xyz WHERE a>1000
           86  +  } {}
           87  +} {0 0 0}
           88  +
           89  +# Repeat all tests with the empty_result_callbacks pragma turned on
           90  +#
           91  +do_test tableapi-3.1 {
           92  +  sqlite_get_table_printf $::dbx {
           93  +    ROLLBACK;
           94  +    PRAGMA empty_result_callbacks = ON;
           95  +    SELECT * FROM xyz WHERE b='%q'
           96  +  } {Hi Y'all}
           97  +} {0 1 2 a b 1 {Hi Y'all}}
           98  +do_test tableapi-3.2 {
           99  +  sqlite_get_table_printf $::dbx {
          100  +    SELECT * FROM xyz
          101  +  } {}
          102  +} {0 1 2 a b 1 {Hi Y'all}}
          103  +do_test tableapi-3.3 {
          104  +  for {set i 2} {$i<=50} {incr i} {
          105  +    sqlite_get_table_printf $::dbx \
          106  +       "INSERT INTO xyz VALUES($i,'(%s)')" $i
          107  +  }
          108  +  sqlite_get_table_printf $::dbx {
          109  +    SELECT * FROM xyz ORDER BY a
          110  +  } {}
          111  +} {0 50 2 a b 1 {Hi Y'all} 2 (2) 3 (3) 4 (4) 5 (5) 6 (6) 7 (7) 8 (8) 9 (9) 10 (10) 11 (11) 12 (12) 13 (13) 14 (14) 15 (15) 16 (16) 17 (17) 18 (18) 19 (19) 20 (20) 21 (21) 22 (22) 23 (23) 24 (24) 25 (25) 26 (26) 27 (27) 28 (28) 29 (29) 30 (30) 31 (31) 32 (32) 33 (33) 34 (34) 35 (35) 36 (36) 37 (37) 38 (38) 39 (39) 40 (40) 41 (41) 42 (42) 43 (43) 44 (44) 45 (45) 46 (46) 47 (47) 48 (48) 49 (49) 50 (50)}
          112  +do_test tableapi-3.3.1 {
          113  +  sqlite_get_table_printf $::dbx {
          114  +    SELECT * FROM xyz  WHERE a>49 ORDER BY a
          115  +  } {}
          116  +} {0 1 2 a b 50 (50)}
          117  +do_test tableapi-3.3.2 {
          118  +  sqlite_get_table_printf $::dbx {
          119  +    SELECT * FROM xyz WHERE a>47 ORDER BY a
          120  +  } {}
          121  +} {0 3 2 a b 48 (48) 49 (49) 50 (50)}
          122  +do_test tableapi-3.4 {
          123  +  set ::big_str [sqlite_mprintf_str {%500'* Hello %500'*} 0 0 {}]
          124  +  sqlite_get_table_printf $::dbx {
          125  +    INSERT INTO xyz VALUES(51,'%q')
          126  +  } $::big_str
          127  +} {0 0 0}
          128  +do_test tableapi-3.5 {
          129  +  sqlite_get_table_printf $::dbx {
          130  +    SELECT * FROM xyz WHERE a>49 ORDER BY a;
          131  +  } {}
          132  +} "0 2 2 a b 50 (50) 51 \173$::big_str\175"
          133  +do_test tableapi-3.6 {
          134  +  sqlite_get_table_printf $::dbx {
          135  +    INSERT INTO xyz VALUES(52,NULL)
          136  +  } {}
          137  +  sqlite_get_table_printf $::dbx {
          138  +    SELECT * FROM xyz WHERE a IN (42,50,52) ORDER BY a DESC
          139  +  } {}
          140  +} {0 3 2 a b 52 NULL 50 (50) 42 (42)}
          141  +do_test tableapi-3.7 {
          142  +  sqlite_get_table_printf $::dbx {
          143  +    SELECT * FROM xyz WHERE a>1000
          144  +  } {}
          145  +} {0 0 2 a b}
    82    146   
    83    147   do_test tableapi-99.0 {
    84    148     sqlite_close $::dbx
    85    149   } {}
    86    150   
    87    151   finish_test

Changes to www/changes.tcl.

    12     12   }
    13     13   
    14     14   
    15     15   proc chng {date desc} {
    16     16     puts "<DT><B>$date</B></DT>"
    17     17     puts "<DD><P><UL>$desc</UL></P></DD>"
    18     18   }
           19  +
           20  +chng {2001 Oct 20 (2.0.7)} {
           21  +<li>Patches from Christian Werner</li>
           22  +}
    19     23   
    20     24   chng {2001 Oct 19 (2.0.6)} {
    21     25   <li>Added the EMPTY_RESULT_CALLBACKS pragma</li>
    22     26   <li>Support for UTF-8 and ISO8859 characters in column and table names.</li>
    23     27   <li>Bug fix: Compute correct table names with the FULL_COLUMN_NAMES pragma
    24     28       is turned on.</li>
    25     29   }