/ Check-in [cc36b4e0]
Login

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

Overview
Comment:Enhanced test coverage. (CVS 5598)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:cc36b4e016a1f519ca81d591de3a551ee8aa6813
User & Date: drh 2008-08-22 16:29:51
Context
2008-08-22
17:09
Relinquish the pcache mutex before calling an xStress callback. This ensures that the pcache mutex is never held while IO is performed. (CVS 5599) check-in: 8fe234b2 user: danielk1977 tags: trunk
16:29
Enhanced test coverage. (CVS 5598) check-in: cc36b4e0 user: drh tags: trunk
16:22
When recycling a page, try to find one that does not require a call to xSync() on the journal file. Also simplify some of the mutex related things in pcache. (CVS 5597) check-in: 93dbc542 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.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 routines used for analyzing expressions and
    13     13   ** for generating VDBE code that evaluates expressions in SQLite.
    14     14   **
    15         -** $Id: expr.c,v 1.389 2008/08/20 16:35:10 drh Exp $
           15  +** $Id: expr.c,v 1.390 2008/08/22 16:29:51 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #include <ctype.h>
    19     19   
    20     20   /*
    21     21   ** Return the 'affinity' of the expression pExpr if any.
    22     22   **
................................................................................
  2419   2419     Parse *pParse,     /* Parsing context */
  2420   2420     ExprList *pList,   /* The expression list to be coded */
  2421   2421     int target,        /* Where to write results */
  2422   2422     int doHardCopy     /* Call sqlite3ExprHardCopy on each element if true */
  2423   2423   ){
  2424   2424     struct ExprList_item *pItem;
  2425   2425     int i, n;
  2426         -  assert( pList!=0 || pParse->db->mallocFailed );
  2427         -  if( pList==0 ){
  2428         -    return 0;
  2429         -  }
         2426  +  assert( pList!=0 );
  2430   2427     assert( target>0 );
  2431   2428     n = pList->nExpr;
  2432   2429     for(pItem=pList->a, i=0; i<n; i++, pItem++){
  2433   2430       sqlite3ExprCode(pParse, pItem->pExpr, target+i);
  2434   2431       if( doHardCopy ) sqlite3ExprHardCopy(pParse, target, n);
  2435   2432     }
  2436   2433     return n;

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.468 2008/08/21 14:54:29 drh Exp $
           15  +** $Id: select.c,v 1.469 2008/08/22 16:29:51 drh 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.
................................................................................
  3145   3145   */
  3146   3146   static int selectAddSubqueryTypeInfo(Walker *pWalker, Select *p){
  3147   3147     Parse *pParse;
  3148   3148     int i;
  3149   3149     SrcList *pTabList;
  3150   3150     struct SrcList_item *pFrom;
  3151   3151   
  3152         -  if( (p->selFlags & SF_Resolved)==0 ){
  3153         -    /* If the ORDER BY clause of a compound SELECT contains a subquery,
  3154         -    ** that subquery will not yet have been resolved. */
  3155         -    return WRC_Prune;
  3156         -  }
         3152  +  assert( p->selFlags & SF_Resolved );
  3157   3153     if( (p->selFlags & SF_HasTypeInfo)==0 ){
  3158   3154       p->selFlags |= SF_HasTypeInfo;
  3159   3155       pParse = pWalker->pParse;
  3160   3156       pTabList = p->pSrc;
  3161   3157       for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
  3162   3158         Table *pTab = pFrom->pTab;
  3163   3159         if( pTab && (pTab->tabFlags & TF_Ephemeral)!=0 ){

Changes to test/expr.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 expressions.
    13     13   #
    14         -# $Id: expr.test,v 1.64 2008/07/30 13:27:11 drh Exp $
           14  +# $Id: expr.test,v 1.65 2008/08/22 16:29:51 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   execsql {CREATE TABLE test1(i1 int, i2 int, r1 real, r2 real, t1 text, t2 text)}
................................................................................
   602    602   test_expr2 expr-7.58  {(a||'')<='1'}                  {1}
   603    603   
   604    604   test_expr2 expr-7.59 {LIKE('10%',b)}                  {10 20}
   605    605   test_expr2 expr-7.60 {LIKE('_4',b)}                   {6}
   606    606   test_expr2 expr-7.61 {GLOB('1?',a)}            {10 11 12 13 14 15 16 17 18 19}
   607    607   test_expr2 expr-7.62 {GLOB('1*4',b)}                  {10 14}
   608    608   test_expr2 expr-7.63 {GLOB('*1[456]',b)}              {4}
          609  +
          610  +breakpoint
          611  +test_expr2 expr-7.64 {b = abs(-2)}                    {1}
          612  +test_expr2 expr-7.65 {b = abs(+-2)}                   {1}
          613  +test_expr2 expr-7.66 {b = abs(++-2)}                  {1}
          614  +test_expr2 expr-7.67 {b = abs(+-+-2)}                 {1}
          615  +test_expr2 expr-7.68 {b = abs(+-++-2)}                {1}
          616  +test_expr2 expr-7.69 {b = abs(++++-2)}                {1}
          617  +test_expr2 expr-7.70 {b = 5 - abs(+3)}                {1}
          618  +test_expr2 expr-7.71 {b = 5 - abs(-3)}                {1}
          619  +test_expr2 expr-7.72 {b = abs(-2.0)}                  {1}
          620  +test_expr2 expr-7.73 {b = 6 - abs(-a)}                {2}
          621  +test_expr2 expr-7.74 {b = abs(8.0)}                   {3}
          622  +
   609    623   
   610    624   # Test the CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP expressions.
   611    625   #
   612    626   set sqlite_current_time 1157124849
   613    627   do_test expr-8.1 {
   614    628     execsql {SELECT CURRENT_TIME}
   615    629   } {15:34:09}