/ Check-in [93deaf54]
Login

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

Overview
Comment:A different fix for the problem with opening existing files. See also check-in (1358). (CVS 1359)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 93deaf54c6e1daee0c89a5e2a7d4a5e712ece3f4
User & Date: drh 2004-05-11 09:57:35
Context
2004-05-11
10:04
Change sqlite_ to sqlite3_ in the attach2.test test script. (CVS 1360) check-in: 98f756e6 user: drh tags: trunk
09:57
A different fix for the problem with opening existing files. See also check-in (1358). (CVS 1359) check-in: 93deaf54 user: drh tags: trunk
09:50
Fix a bug that was preventing the library from opening existing files. (CVS 1358) check-in: ad064bd4 user: danielk1977 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.281 2004/05/11 09:31:32 drh Exp $
           46  +** $Id: vdbe.c,v 1.282 2004/05/11 09:57:35 drh Exp $
    47     47   */
    48     48   #include "sqliteInt.h"
    49     49   #include "os.h"
    50     50   #include <ctype.h>
    51     51   #include "vdbeInt.h"
    52     52   
    53     53   /*
................................................................................
  2693   2693         }
  2694   2694         case SQLITE_OK: {
  2695   2695           int flags = sqlite3BtreeFlags(pCur->pCursor);
  2696   2696           pCur->intKey = (flags & BTREE_INTKEY)!=0;
  2697   2697           pCur->zeroData = (flags & BTREE_ZERODATA)!=0;
  2698   2698           busy = 0;
  2699   2699           break;
         2700  +      }
         2701  +      case SQLITE_EMPTY: {
         2702  +        rc = SQLITE_OK;
         2703  +        busy = 0;
         2704  +        break;
  2700   2705         }
  2701   2706         default: {
  2702   2707           goto abort_due_to_error;
  2703   2708         }
  2704   2709       }
  2705   2710     }while( busy );
  2706   2711     break;
................................................................................
  3656   3661   ** If P2 is 0 or if the table or index is not empty, fall through
  3657   3662   ** to the following instruction.
  3658   3663   */
  3659   3664   case OP_Rewind: {
  3660   3665     int i = pOp->p1;
  3661   3666     Cursor *pC;
  3662   3667     BtCursor *pCrsr;
         3668  +  int res;
  3663   3669   
  3664   3670     assert( i>=0 && i<p->nCursor );
  3665   3671     pC = &p->aCsr[i];
  3666   3672     if( (pCrsr = pC->pCursor)!=0 ){
  3667         -    int res;
  3668   3673       rc = sqlite3BtreeFirst(pCrsr, &res);
  3669   3674       pC->atFirst = res==0;
  3670         -    pC->nullRow = res;
  3671   3675       pC->deferredMoveto = 0;
  3672         -    if( res && pOp->p2>0 ){
  3673         -      pc = pOp->p2 - 1;
  3674         -    }
  3675   3676     }else{
  3676         -    pC->nullRow = 0;
         3677  +    res = 1;
         3678  +  }
         3679  +  pC->nullRow = res;
         3680  +  if( res && pOp->p2>0 ){
         3681  +    pc = pOp->p2 - 1;
  3677   3682     }
  3678   3683     break;
  3679   3684   }
  3680   3685   
  3681   3686   /* Opcode: Next P1 P2 *
  3682   3687   **
  3683   3688   ** Advance cursor P1 so that it points to the next key/data pair in its

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.15 2004/05/11 09:31:32 drh Exp $
           15  +# $Id: attach.test,v 1.16 2004/05/11 09:57:35 drh 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