SQLite

Check-in [8c163fc0c7]
Login

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

Overview
Comment:Make sure the schema loader callback can handle EMPTY_RESULT_CALLBACKS being on. Ticket #406. (CVS 1065)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8c163fc0c7c721b7a5fa6727b0e90bff4484c782
User & Date: drh 2003-07-27 17:26:23.000
Context
2003-07-27
18:59
When creating a new journal file, open a (read-only) file descriptor on the directory containing the journal and sync that directory once to make sure that the journal filename entry gets into the directory. Ticket #410. (CVS 1066) (check-in: 09c10fe3c9 user: drh tags: trunk)
17:26
Make sure the schema loader callback can handle EMPTY_RESULT_CALLBACKS being on. Ticket #406. (CVS 1065) (check-in: 8c163fc0c7 user: drh tags: trunk)
17:16
In the VDBE, when an integer value will not fit into a 32-bit int, store it in a double instead. Ticket #408. (CVS 1064) (check-in: 7514c3db16 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/main.c.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
**
*************************************************************************
** Main file for the SQLite library.  The routines in this file
** implement the programmer interface to the library.  Routines in
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
** $Id: main.c,v 1.139 2003/07/22 09:24:45 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
#include <ctype.h>

/*
** A pointer to this structure is used to communicate information







|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
**
*************************************************************************
** Main file for the SQLite library.  The routines in this file
** implement the programmer interface to the library.  Routines in
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
** $Id: main.c,v 1.140 2003/07/27 17:26:23 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
#include <ctype.h>

/*
** A pointer to this structure is used to communicate information
54
55
56
57
58
59
60

61
62
63
64
65
66
67
static
int sqliteInitCallback(void *pInit, int argc, char **argv, char **azColName){
  InitData *pData = (InitData*)pInit;
  Parse sParse;
  int nErr = 0;

  assert( argc==5 );

  if( argv[0]==0 ){
    corruptSchema(pData);
    return 1;
  }
  switch( argv[0][0] ){
    case 'v':
    case 'i':







>







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
static
int sqliteInitCallback(void *pInit, int argc, char **argv, char **azColName){
  InitData *pData = (InitData*)pInit;
  Parse sParse;
  int nErr = 0;

  assert( argc==5 );
  if( argv==0 ) return 0;   /* Might happen if EMPTY_RESULT_CALLBACKS are on */
  if( argv[0]==0 ){
    corruptSchema(pData);
    return 1;
  }
  switch( argv[0][0] ){
    case 'v':
    case 'i':
Changes to test/pragma.test.
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
# This file implements tests for the PRAGMA command.
#
# $Id: pragma.test,v 1.5 2003/06/15 23:42:25 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Delete the preexisting database to avoid the special setup
# that the "all.test" script does.
#







|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
# This file implements tests for the PRAGMA command.
#
# $Id: pragma.test,v 1.6 2003/07/27 17:26:23 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Delete the preexisting database to avoid the special setup
# that the "all.test" script does.
#
173
174
175
176
177
178
179












180
181
182
183
184
185
186
} {}
do_test pragma-2.2 {
  execsql {
    PRAGMA empty_result_callbacks=on;
  }
  sqlite_datatypes $::DB {SELECT * FROM sqlite_master}
} {text text text integer text}












do_test pragma-2.3 {
  execsql {
    CREATE TABLE t1(
       a INTEGER,
       b TEXT,
       c WHATEVER,
       d CLOB,







>
>
>
>
>
>
>
>
>
>
>
>







173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
} {}
do_test pragma-2.2 {
  execsql {
    PRAGMA empty_result_callbacks=on;
  }
  sqlite_datatypes $::DB {SELECT * FROM sqlite_master}
} {text text text integer text}

# Make sure we can read the schema when empty_result_callbacks are
# turned on. Ticket #406
do_test pragma-2.2.1 {
  execsql {
    BEGIN;
    CREATE TABLE tabx(a,b,c,d);
    ROLLBACK;
    SELECT count(*) FROM sqlite_master;
  }
} {0}

do_test pragma-2.3 {
  execsql {
    CREATE TABLE t1(
       a INTEGER,
       b TEXT,
       c WHATEVER,
       d CLOB,