/ Check-in [a88580bc]
Login

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

Overview
Comment:Bug fix in codec processing. (CVS 2846)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a88580bce045ee1c11cc6fd986ee7bab043ded4f
User & Date: drh 2005-12-29 23:04:02
Context
2005-12-29
23:33
Add support for CREATE TABLE IF NOT EXISTS. (CVS 2847) check-in: 0bd9e35f user: drh tags: trunk
23:04
Bug fix in codec processing. (CVS 2846) check-in: a88580bc user: drh tags: trunk
19:23
Add serial-types 8 and 9 for integer constants of 0 and 1 that use zero bytes of storage. Make the default file format 4. Add the SQLITE_DEFAULT_FILE_FORMAT compile-time option to lower the default file format number so that newly created databases can be read and written by older versions of SQLite. (CVS 2845) check-in: ae301db8 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/attach.c.

     7      7   **    May you do good and not evil.
     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 code used to implement the ATTACH and DETACH commands.
    13     13   **
    14         -** $Id: attach.c,v 1.37 2005/12/09 14:25:08 danielk1977 Exp $
           14  +** $Id: attach.c,v 1.38 2005/12/29 23:04:02 drh Exp $
    15     15   */
    16     16   #include "sqliteInt.h"
    17     17   
    18     18   /*
    19     19   ** Resolve an expression that was part of an ATTACH or DETACH statement. This
    20     20   ** is slightly different from resolving a normal SQL expression, because simple
    21     21   ** identifiers are treated as strings, not possible column names or aliases.
................................................................................
   126    126     /* Open the database file */
   127    127     rc = sqlite3BtreeFactory(db, zFile, 0, MAX_PAGES, &aNew->pBt);
   128    128   
   129    129   #if SQLITE_HAS_CODEC
   130    130     {
   131    131       extern int sqlite3CodecAttach(sqlite3*, int, void*, int);
   132    132       extern void sqlite3CodecGetKey(sqlite3*, int, void**, int*);
   133         -
          133  +    int nKey;
          134  +    char *zKey;
   134    135       int t = sqlite3_value_type(argv[2]);
   135    136       switch( t ){
   136    137         case SQLITE_INTEGER:
   137    138         case SQLITE_FLOAT:
   138    139           zErrDyn = sqliteStrDup("Invalid key value");
   139    140           rc = SQLITE_ERROR;
   140    141           break;