/ Check-in [a82980fd]
Login

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

Overview
Comment:More work on optionally removing unused features at compile-time. (CVS 2049)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a82980fd70285820c64b42393ef85a9e21addc5d
User & Date: drh 2004-11-03 13:59:05
Context
2004-11-03
16:27
Update tests to work even if some features of the library are disabled. (CVS 2050) check-in: b11fc9b3 user: drh tags: trunk
13:59
More work on optionally removing unused features at compile-time. (CVS 2049) check-in: a82980fd user: drh tags: trunk
11:37
Auto-vacuum bug: Deallocate pointer-map pages when shrinking a database file. (CVS 2048) check-in: bec6a65a user: danielk1977 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/parse.y.

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
**
*************************************************************************
** This file contains SQLite's grammar for SQL.  Process this file
** using the lemon parser generator to generate C code that runs
** the parser.  Lemon will also generate a header file containing
** numeric codes for all of the tokens.
**
** @(#) $Id: parse.y,v 1.146 2004/11/03 03:59:57 drh Exp $
*/
%token_prefix TK_
%token_type {Token}
%default_type {Token}
%extra_argument {Parse *pParse}
%syntax_error {
  if( pParse->zErrMsg==0 ){







|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
**
*************************************************************************
** This file contains SQLite's grammar for SQL.  Process this file
** using the lemon parser generator to generate C code that runs
** the parser.  Lemon will also generate a header file containing
** numeric codes for all of the tokens.
**
** @(#) $Id: parse.y,v 1.147 2004/11/03 13:59:05 drh Exp $
*/
%token_prefix TK_
%token_type {Token}
%default_type {Token}
%extra_argument {Parse *pParse}
%syntax_error {
  if( pParse->zErrMsg==0 ){

Changes to src/util.c.

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
...
895
896
897
898
899
900
901


902
903
904
905
906
907
908
...
909
910
911
912
913
914
915

916

917
918
919
920
921
922
923
...
928
929
930
931
932
933
934

935
936
937
938
939
940
941
**
*************************************************************************
** Utility functions used throughout sqlite.
**
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
** $Id: util.c,v 1.119 2004/09/30 13:43:13 drh Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
#include <ctype.h>

#if SQLITE_DEBUG>2 && defined(__GLIBC__)
#include <execinfo.h>
................................................................................
  do{
    i++;
    v >>= 7;
  }while( v!=0 && i<9 );
  return i;
}



/*
** Translate a single byte of Hex into an integer.
*/
static int hexToInt(int h){
  if( h>='0' && h<='9' ){
    return h - '0';
  }else if( h>='a' && h<='f' ){
................................................................................
    return h - 'a' + 10;
  }else if( h>='A' && h<='F' ){
    return h - 'A' + 10;
  }else{
    return 0;
  }
}



/*
** Convert a BLOB literal of the form "x'hhhhhh'" into its binary
** value.  Return a pointer to its binary value.  Space to hold the
** binary value has been obtained from malloc and must be freed by
** the calling routine.
*/
void *sqlite3HexToBlob(const char *z){
................................................................................

  zBlob = (char *)sqliteMalloc(n/2);
  for(i=0; i<n; i+=2){
    zBlob[i/2] = (hexToInt(z[i])<<4) | hexToInt(z[i+1]);
  }
  return zBlob;
}


#if defined(SQLITE_TEST)
/*
** Convert text generated by the "%p" conversion format back into
** a pointer.
*/
void *sqlite3TextToPtr(const char *z){







|







 







>
>







 







>

>







 







>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
...
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
...
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
...
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
**
*************************************************************************
** Utility functions used throughout sqlite.
**
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
** $Id: util.c,v 1.120 2004/11/03 13:59:05 drh Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
#include <ctype.h>

#if SQLITE_DEBUG>2 && defined(__GLIBC__)
#include <execinfo.h>
................................................................................
  do{
    i++;
    v >>= 7;
  }while( v!=0 && i<9 );
  return i;
}

#if (!defined(SQLITE_OMIT_BLOB_LITERAL) && !defined(SQLITE_HAS_CODEC)) \
    || defined(SQLITE_TEST)
/*
** Translate a single byte of Hex into an integer.
*/
static int hexToInt(int h){
  if( h>='0' && h<='9' ){
    return h - '0';
  }else if( h>='a' && h<='f' ){
................................................................................
    return h - 'a' + 10;
  }else if( h>='A' && h<='F' ){
    return h - 'A' + 10;
  }else{
    return 0;
  }
}
#endif /* (!SQLITE_OMIT_BLOB_LITERAL && !SQLITE_HAS_CODEC) || SQLITE_TEST */

#if !defined(SQLITE_OMIT_BLOB_LITERAL) && !defined(SQLITE_HAS_CODEC)
/*
** Convert a BLOB literal of the form "x'hhhhhh'" into its binary
** value.  Return a pointer to its binary value.  Space to hold the
** binary value has been obtained from malloc and must be freed by
** the calling routine.
*/
void *sqlite3HexToBlob(const char *z){
................................................................................

  zBlob = (char *)sqliteMalloc(n/2);
  for(i=0; i<n; i+=2){
    zBlob[i/2] = (hexToInt(z[i])<<4) | hexToInt(z[i+1]);
  }
  return zBlob;
}
#endif /* !SQLITE_OMIT_BLOB_LITERAL && !SQLITE_HAS_CODEC */

#if defined(SQLITE_TEST)
/*
** Convert text generated by the "%p" conversion format back into
** a pointer.
*/
void *sqlite3TextToPtr(const char *z){

Changes to src/vdbe.c.

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
...
709
710
711
712
713
714
715

716
717
718
719
720
721
722
...
738
739
740
741
742
743
744

745
746
747
748
749
750
751
**
** Various scripts scan this source file in order to generate HTML
** documentation, headers files, or other derived files.  The formatting
** of the code in this file is, therefore, important.  See other comments
** in this file for details.  If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
** $Id: vdbe.c,v 1.420 2004/10/31 02:22:50 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
#include <ctype.h>
#include "vdbeInt.h"

/*
................................................................................
    pTos->enc = db->enc;
  }else{
    pTos->flags = MEM_Null;
  }
  break;
}


/* Opcode: HexBlob * * P3
**
** P3 is an UTF-8 SQL hex encoding of a blob. The blob is pushed onto the
** vdbe stack.
**
** The first time this instruction executes, in transforms itself into a
** 'Blob' opcode with a binary blob as P3.
................................................................................
    }
    pOp->p3type = P3_STATIC;
    pOp->p3 = "";
  }

  /* Fall through to the next case, OP_Blob. */
}


/* Opcode: Blob P1 * P3
**
** P3 points to a blob of data P1 bytes long. Push this
** value onto the stack. This instruction is not coded directly
** by the compiler. Instead, the compiler layer specifies
** an OP_HexBlob opcode, with the hex string representation of







|







 







>







 







>







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
...
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
...
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
**
** Various scripts scan this source file in order to generate HTML
** documentation, headers files, or other derived files.  The formatting
** of the code in this file is, therefore, important.  See other comments
** in this file for details.  If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
** $Id: vdbe.c,v 1.421 2004/11/03 13:59:06 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
#include <ctype.h>
#include "vdbeInt.h"

/*
................................................................................
    pTos->enc = db->enc;
  }else{
    pTos->flags = MEM_Null;
  }
  break;
}

#ifndef SQLITE_OMIT_BLOB_LITERAL
/* Opcode: HexBlob * * P3
**
** P3 is an UTF-8 SQL hex encoding of a blob. The blob is pushed onto the
** vdbe stack.
**
** The first time this instruction executes, in transforms itself into a
** 'Blob' opcode with a binary blob as P3.
................................................................................
    }
    pOp->p3type = P3_STATIC;
    pOp->p3 = "";
  }

  /* Fall through to the next case, OP_Blob. */
}
#endif /* SQLITE_OMIT_BLOB_LITERAL */

/* Opcode: Blob P1 * P3
**
** P3 points to a blob of data P1 bytes long. Push this
** value onto the stack. This instruction is not coded directly
** by the compiler. Instead, the compiler layer specifies
** an OP_HexBlob opcode, with the hex string representation of

Changes to test/blob.test.

6
7
8
9
10
11
12
13
14
15
16





17
18
19
20
21
22
23
...
112
113
114
115
116
117
118
119
120
#    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 implements regression tests for SQLite library.
#
# $Id: blob.test,v 1.2 2004/06/19 00:16:31 drh Exp $

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






proc bin_to_hex {blob} {
  set bytes {}
  binary scan $blob \c* bytes
  set bytes2 [list]
  foreach b $bytes {lappend bytes2 [format %02X [expr $b & 0xFF]]}
  join $bytes2 {}
................................................................................
  set blobs [execsql {SELECT * FROM t1}]
  set blobs2 [list]
  foreach b $blobs {lappend blobs2 [bin_to_hex $b]}
  set blobs2
} {CDEF12 345678}

finish_test









|



>
>
>
>
>







 







<
<
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
...
117
118
119
120
121
122
123


#    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 implements regression tests for SQLite library.
#
# $Id: blob.test,v 1.3 2004/11/03 13:59:06 drh Exp $

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

ifcapable {!bloblit} {
  finish_test
  return
}

proc bin_to_hex {blob} {
  set bytes {}
  binary scan $blob \c* bytes
  set bytes2 [list]
  foreach b $bytes {lappend bytes2 [format %02X [expr $b & 0xFF]]}
  join $bytes2 {}
................................................................................
  set blobs [execsql {SELECT * FROM t1}]
  set blobs2 [list]
  foreach b $blobs {lappend blobs2 [bin_to_hex $b]}
  set blobs2
} {CDEF12 345678}

finish_test


Changes to test/enc3.test.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
..
32
33
34
35
36
37
38

39
40
41
42
43
44
45
46
47
48
49
50
51
52

53
#
#***********************************************************************
# This file implements regression tests for SQLite library. 
#
# The focus of this file is testing of the proper handling of conversions
# to the native text representation.
#
# $Id: enc3.test,v 1.2 2004/06/30 03:08:25 drh Exp $

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

do_test enc3-1.1 {
  execsql {
    PRAGMA encoding=utf16le;
................................................................................
  }
} {abc'123 5}
do_test enc3-1.3 {
  execsql {
    SELECT quote(x) || ' ' || quote(y) FROM t1
  }
} {{'abc''123' 5}}

do_test enc3-1.4 {
  execsql {
    DELETE FROM t1;
    INSERT INTO t1 VALUES(x'616263646566',NULL);
    SELECT * FROM t1
  }
} {abcdef {}}
do_test enc3-1.5 {
  execsql {
    SELECT quote(x) || ' ' || quote(y) FROM t1
  }
} {{X'616263646566' NULL}}



finish_test







|







 







>
|
|
|
|
|
|
|
|
|
|
|
|
|

>

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
..
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#
#***********************************************************************
# This file implements regression tests for SQLite library. 
#
# The focus of this file is testing of the proper handling of conversions
# to the native text representation.
#
# $Id: enc3.test,v 1.3 2004/11/03 13:59:06 drh Exp $

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

do_test enc3-1.1 {
  execsql {
    PRAGMA encoding=utf16le;
................................................................................
  }
} {abc'123 5}
do_test enc3-1.3 {
  execsql {
    SELECT quote(x) || ' ' || quote(y) FROM t1
  }
} {{'abc''123' 5}}
ifcapable {bloblit} {
  do_test enc3-1.4 {
    execsql {
      DELETE FROM t1;
      INSERT INTO t1 VALUES(x'616263646566',NULL);
      SELECT * FROM t1
    }
  } {abcdef {}}
  do_test enc3-1.5 {
    execsql {
      SELECT quote(x) || ' ' || quote(y) FROM t1
    }
  } {{X'616263646566' NULL}}
}


finish_test

Changes to test/intpkey.test.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
...
502
503
504
505
506
507
508

509
510
511
512
513

514
515
516
517
518
519
520
521
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
# This file implements tests for the special processing associated
# with INTEGER PRIMARY KEY columns.
#
# $Id: intpkey.test,v 1.19 2004/10/18 21:34:47 drh Exp $

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

# Create a table with a primary key and a datatype other than
# integer
#
................................................................................
  }
} {1 2 3}
do_test intpkey-13.3 {
  catchsql {
    INSERT INTO t1 VALUES('1.5',3,4);
  }
} {1 {datatype mismatch}}

do_test intpkey-13.4 {
  catchsql {
    INSERT INTO t1 VALUES(x'123456',3,4);
  }
} {1 {datatype mismatch}}

do_test intpkey-13.5 {
  catchsql {
    INSERT INTO t1 VALUES('+1234567890',3,4);
  }
} {0 {}}


finish_test







|







 







>
|
|
|
|
|
>








9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
...
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
# This file implements tests for the special processing associated
# with INTEGER PRIMARY KEY columns.
#
# $Id: intpkey.test,v 1.20 2004/11/03 13:59:06 drh Exp $

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

# Create a table with a primary key and a datatype other than
# integer
#
................................................................................
  }
} {1 2 3}
do_test intpkey-13.3 {
  catchsql {
    INSERT INTO t1 VALUES('1.5',3,4);
  }
} {1 {datatype mismatch}}
ifcapable {bloblit} {
  do_test intpkey-13.4 {
    catchsql {
      INSERT INTO t1 VALUES(x'123456',3,4);
    }
  } {1 {datatype mismatch}}
}
do_test intpkey-13.5 {
  catchsql {
    INSERT INTO t1 VALUES('+1234567890',3,4);
  }
} {0 {}}


finish_test

Changes to test/pragma.test.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
#    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.18 2004/11/02 18:15:49 drh Exp $

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

# Test organization:
#
# pragma-1.*: Test cache_size, default_cache_size and synchronous on main db.
................................................................................
#
do_test pragma-6.1 {
  set res {}
  foreach {idx name file} [execsql {pragma database_list}] {
    lappend res $idx $name
  }
  set res
} {0 main 2 aux}
do_test pragma-6.2 {
  execsql {
    pragma table_info(t2)
  }
} {0 a numeric 0 {} 0 1 b numeric 0 {} 0 2 c numeric 0 {} 0}
do_test pragma-6.3 {
  execsql {







|







 







|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
#    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.19 2004/11/03 13:59:06 drh Exp $

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

# Test organization:
#
# pragma-1.*: Test cache_size, default_cache_size and synchronous on main db.
................................................................................
#
do_test pragma-6.1 {
  set res {}
  foreach {idx name file} [execsql {pragma database_list}] {
    lappend res $idx $name
  }
  set res
} {0 main 1 temp 2 aux}
do_test pragma-6.2 {
  execsql {
    pragma table_info(t2)
  }
} {0 a numeric 0 {} 0 1 b numeric 0 {} 0 2 c numeric 0 {} 0}
do_test pragma-6.3 {
  execsql {

Changes to test/sort.test.

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
351
352
353
354
355
356
357


358
359
360
361
362
363
364
...
393
394
395
396
397
398
399

400
401
402
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is testing the CREATE TABLE statement.
#
# $Id: sort.test,v 1.15 2004/08/20 18:34:20 drh Exp $

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

# Create a bunch of data to sort against
#
do_test sort-1.0 {
................................................................................
    CREATE TABLE t5(a real, b text);
    INSERT INTO t5 VALUES(100,'A1');
    INSERT INTO t5 VALUES(100.0,'A2');
    SELECT * FROM t5 ORDER BY a, b;
  }
} {100 A1 100.0 A2}



# BLOBs should sort after TEXT
#
do_test sort-9.1 {
  execsql {
    CREATE TABLE t6(x, y);
    INSERT INTO t6 VALUES(1,1);
    INSERT INTO t6 VALUES(2,'1');
................................................................................
  }
} {2 3}
do_test sort-9.7 {
  execsql {
    SELECT x FROM t6 WHERE y>'1'
  }
} {3}



finish_test







|







 







>
>







 







>

<

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
...
395
396
397
398
399
400
401
402
403

404
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is testing the CREATE TABLE statement.
#
# $Id: sort.test,v 1.16 2004/11/03 13:59:06 drh Exp $

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

# Create a bunch of data to sort against
#
do_test sort-1.0 {
................................................................................
    CREATE TABLE t5(a real, b text);
    INSERT INTO t5 VALUES(100,'A1');
    INSERT INTO t5 VALUES(100.0,'A2');
    SELECT * FROM t5 ORDER BY a, b;
  }
} {100 A1 100.0 A2}


ifcapable {bloblit} {
# BLOBs should sort after TEXT
#
do_test sort-9.1 {
  execsql {
    CREATE TABLE t6(x, y);
    INSERT INTO t6 VALUES(1,1);
    INSERT INTO t6 VALUES(2,'1');
................................................................................
  }
} {2 3}
do_test sort-9.7 {
  execsql {
    SELECT x FROM t6 WHERE y>'1'
  }
} {3}
} ;# endif bloblit


finish_test

Changes to test/tester.tcl.

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
238
239
240
241
242
243
244

245
246
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements some common TCL routines used for regression
# testing the SQLite library
#
# $Id: tester.tcl,v 1.39 2004/10/30 20:23:10 drh Exp $

# Make sure tclsqlite3 was compiled correctly.  Abort now with an
# error message if not.
#
if {[sqlite3 -tcl-uses-utf]} {
  if {"\u1234"=="u1234"} {
    puts stderr "***** BUILD PROBLEM *****"
................................................................................
}

# Evaluate a boolean expression of capabilities.  If true, execute the
# code.  Omit the code if false.
#
proc ifcapable {expr code} {
  regsub -all {[a-z]+} $expr {$::sqlite_options(&)} e2

  if $e2 {uplevel 1 $code}
}







|







 







>
|

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
238
239
240
241
242
243
244
245
246
247
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements some common TCL routines used for regression
# testing the SQLite library
#
# $Id: tester.tcl,v 1.40 2004/11/03 13:59:06 drh Exp $

# Make sure tclsqlite3 was compiled correctly.  Abort now with an
# error message if not.
#
if {[sqlite3 -tcl-uses-utf]} {
  if {"\u1234"=="u1234"} {
    puts stderr "***** BUILD PROBLEM *****"
................................................................................
}

# Evaluate a boolean expression of capabilities.  If true, execute the
# code.  Omit the code if false.
#
proc ifcapable {expr code} {
  regsub -all {[a-z]+} $expr {$::sqlite_options(&)} e2
  if !($e2) return
  return -code [catch {uplevel 1 $code}]
}

Changes to test/types.test.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
..
60
61
62
63
64
65
66



67

68
69
70
71
72
73
74
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library. Specfically
# it tests that the different storage classes (integer, real, text etc.)
# all work correctly.
#
# $Id: types.test,v 1.11 2004/08/20 18:34:20 drh Exp $

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

# Tests in this file are organized roughly as follows:
#
# types-1.*.*: Test that values are stored using the expected storage
................................................................................
  { 5      integer integer text integer }
  { '5.0'  integer real    text text    }
  { '-5.0' integer real    text text    }
  { '-5.0' integer real    text text    }
  { '5'    integer integer text text    }
  { 'abc'  text    text    text text    }
  { NULL   null    null    null null    }



  { X'00'  blob    blob    blob blob    }

}

# This code tests that the storage classes specified above (in the $values
# table) are correctly assigned when values are inserted using a statement
# of the form:
#
# INSERT INTO <table> VALUE(<values>);







|







 







>
>
>
|
>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
..
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library. Specfically
# it tests that the different storage classes (integer, real, text etc.)
# all work correctly.
#
# $Id: types.test,v 1.12 2004/11/03 13:59:06 drh Exp $

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

# Tests in this file are organized roughly as follows:
#
# types-1.*.*: Test that values are stored using the expected storage
................................................................................
  { 5      integer integer text integer }
  { '5.0'  integer real    text text    }
  { '-5.0' integer real    text text    }
  { '-5.0' integer real    text text    }
  { '5'    integer integer text text    }
  { 'abc'  text    text    text text    }
  { NULL   null    null    null null    }
}
ifcapable {bloblit} {
  lappend values {
    { X'00'  blob    blob    blob blob    }
  }
}

# This code tests that the storage classes specified above (in the $values
# table) are correctly assigned when values are inserted using a statement
# of the form:
#
# INSERT INTO <table> VALUE(<values>);

Changes to test/vacuum.test.

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
197
198
199
200
201
202
203

204
205
206
207
208
209
210
211
212
213
214
215

216
217
218
219
220
221
222
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is testing the VACUUM statement.
#
# $Id: vacuum.test,v 1.26 2004/10/30 20:23:10 drh Exp $

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

set fcnt 1
proc cksum {{db db}} {
  set sql "SELECT name, type, sql FROM sqlite_master ORDER BY name, type"
................................................................................
do_test vacuum-6.2 {
  execsql {
    select * from "abc abc";
  }
} {1 2 3}

# Also ensure that blobs survive a vacuum.

do_test vacuum-6.3 {
  execsql {
    DELETE FROM "abc abc";
    INSERT INTO "abc abc" VALUES(X'00112233', NULL, NULL);
    VACUUM;
  }
} {}
do_test vacuum-6.4 {
  execsql {
    select count(*) from "abc abc" WHERE a = X'00112233';
  }
} {1}


# Check what happens when an in-memory database is vacuumed.
do_test vacuum-7.0 {
  sqlite3 db2 :memory:
  execsql {
    CREATE TABLE t1(t);
    VACUUM;







|







 







>
|
|
|
|
|
|
|
|
|
|
|
|
>







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is testing the VACUUM statement.
#
# $Id: vacuum.test,v 1.27 2004/11/03 13:59:06 drh Exp $

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

set fcnt 1
proc cksum {{db db}} {
  set sql "SELECT name, type, sql FROM sqlite_master ORDER BY name, type"
................................................................................
do_test vacuum-6.2 {
  execsql {
    select * from "abc abc";
  }
} {1 2 3}

# Also ensure that blobs survive a vacuum.
ifcapable {bloblit} {
  do_test vacuum-6.3 {
    execsql {
      DELETE FROM "abc abc";
      INSERT INTO "abc abc" VALUES(X'00112233', NULL, NULL);
      VACUUM;
    }
  } {}
  do_test vacuum-6.4 {
    execsql {
      select count(*) from "abc abc" WHERE a = X'00112233';
    }
  } {1}
}

# Check what happens when an in-memory database is vacuumed.
do_test vacuum-7.0 {
  sqlite3 db2 :memory:
  execsql {
    CREATE TABLE t1(t);
    VACUUM;