/ 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 Unified Diffs Show Whitespace Changes Patch

Changes to src/attach.c.

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
126
127
128
129
130
131
132
133

134
135
136
137
138
139
140
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** This file contains code used to implement the ATTACH and DETACH commands.
**
** $Id: attach.c,v 1.37 2005/12/09 14:25:08 danielk1977 Exp $
*/
#include "sqliteInt.h"

/*
** Resolve an expression that was part of an ATTACH or DETACH statement. This
** is slightly different from resolving a normal SQL expression, because simple
** identifiers are treated as strings, not possible column names or aliases.
................................................................................
  /* Open the database file */
  rc = sqlite3BtreeFactory(db, zFile, 0, MAX_PAGES, &aNew->pBt);

#if SQLITE_HAS_CODEC
  {
    extern int sqlite3CodecAttach(sqlite3*, int, void*, int);
    extern void sqlite3CodecGetKey(sqlite3*, int, void**, int*);


    int t = sqlite3_value_type(argv[2]);
    switch( t ){
      case SQLITE_INTEGER:
      case SQLITE_FLOAT:
        zErrDyn = sqliteStrDup("Invalid key value");
        rc = SQLITE_ERROR;
        break;







|







 







|
>







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** This file contains code used to implement the ATTACH and DETACH commands.
**
** $Id: attach.c,v 1.38 2005/12/29 23:04:02 drh Exp $
*/
#include "sqliteInt.h"

/*
** Resolve an expression that was part of an ATTACH or DETACH statement. This
** is slightly different from resolving a normal SQL expression, because simple
** identifiers are treated as strings, not possible column names or aliases.
................................................................................
  /* Open the database file */
  rc = sqlite3BtreeFactory(db, zFile, 0, MAX_PAGES, &aNew->pBt);

#if SQLITE_HAS_CODEC
  {
    extern int sqlite3CodecAttach(sqlite3*, int, void*, int);
    extern void sqlite3CodecGetKey(sqlite3*, int, void**, int*);
    int nKey;
    char *zKey;
    int t = sqlite3_value_type(argv[2]);
    switch( t ){
      case SQLITE_INTEGER:
      case SQLITE_FLOAT:
        zErrDyn = sqliteStrDup("Invalid key value");
        rc = SQLITE_ERROR;
        break;