Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Remove the COPY command. (CVS 1477) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
287f86731c71401dbac098e08357367b |
User & Date: | drh 2004-05-27 17:22:55.000 |
Context
2004-05-27
| ||
19:59 | Change the record format to include an extra varint at the beginning to record the number of bytes in the header. (CVS 1478) (check-in: 0c4d138807 user: drh tags: trunk) | |
17:22 | Remove the COPY command. (CVS 1477) (check-in: 287f86731c user: drh tags: trunk) | |
14:23 | Enhance the C function used to test sqlite3_create_function() from Tcl. (CVS 1476) (check-in: c85e5f1528 user: danielk1977 tags: trunk) | |
Changes
Changes to main.mk.
︙ | ︙ | |||
50 51 52 53 54 55 56 | # This is how we compile # TCCX = $(TCC) $(OPTS) $(THREADSAFE) $(USLEEP) -I. -I$(TOP)/src # Object files for the SQLite library. # | | < | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | # This is how we compile # TCCX = $(TCC) $(OPTS) $(THREADSAFE) $(USLEEP) -I. -I$(TOP)/src # Object files for the SQLite library. # LIBOBJ = attach.o auth.o btree.o build.o date.o delete.o \ expr.o func.o hash.o insert.o \ main.o opcodes.o os_mac.o os_unix.o os_win.o \ pager.o parse.o pragma.o printf.o random.o \ select.o table.o tokenize.o trigger.o update.o util.o vacuum.o \ vdbe.o vdbeapi.o vdbeaux.o vdbemem.o \ where.o tclsqlite.o utf.o legacy.o # All of the source code files. # SRC = \ $(TOP)/src/attach.c \ $(TOP)/src/auth.c \ $(TOP)/src/btree.c \ $(TOP)/src/btree.h \ $(TOP)/src/build.c \ $(TOP)/src/date.c \ $(TOP)/src/delete.c \ $(TOP)/src/encode.c \ $(TOP)/src/expr.c \ $(TOP)/src/func.c \ $(TOP)/src/hash.c \ $(TOP)/src/hash.h \ |
︙ | ︙ | |||
215 216 217 218 219 220 221 | echo '"#define SQLITE_PTR_SZ %d",sizeof(char*));' >>temp.c echo 'exit(0);}' >>temp.c $(BCC) -o temp temp.c ./temp >config.h echo >>config.h rm -f temp.c temp | < < < | 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | echo '"#define SQLITE_PTR_SZ %d",sizeof(char*));' >>temp.c echo 'exit(0);}' >>temp.c $(BCC) -o temp temp.c ./temp >config.h echo >>config.h rm -f temp.c temp date.o: $(TOP)/src/date.c $(HDR) $(TCCX) -c $(TOP)/src/date.c delete.o: $(TOP)/src/delete.c $(HDR) $(TCCX) -c $(TOP)/src/delete.c encode.o: $(TOP)/src/encode.c |
︙ | ︙ |
Deleted src/copy.c.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to src/parse.y.
︙ | ︙ | |||
10 11 12 13 14 15 16 | ** ************************************************************************* ** 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. ** | | | 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.119 2004/05/27 17:22:55 drh Exp $ */ %token_prefix TK_ %token_type {Token} %default_type {Token} %extra_argument {Parse *pParse} %syntax_error { if( pParse->zErrMsg==0 ){ |
︙ | ︙ | |||
118 119 120 121 122 123 124 | // The following directive causes tokens ABORT, AFTER, ASC, etc. to // fallback to ID if they will not parse as their original value. // This obviates the need for the "id" nonterminal. // %fallback ID ABORT AFTER ASC ATTACH BEFORE BEGIN CASCADE CLUSTER CONFLICT | | | 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | // The following directive causes tokens ABORT, AFTER, ASC, etc. to // fallback to ID if they will not parse as their original value. // This obviates the need for the "id" nonterminal. // %fallback ID ABORT AFTER ASC ATTACH BEFORE BEGIN CASCADE CLUSTER CONFLICT DATABASE DEFERRED DESC DETACH EACH END EXPLAIN FAIL FOR GLOB IGNORE IMMEDIATE INITIALLY INSTEAD LIKE MATCH KEY OF OFFSET PRAGMA RAISE REPLACE RESTRICT ROW STATEMENT TEMP TRIGGER VACUUM VIEW. // Define operator precedence early so that this is the first occurance // of the operator tokens in the grammer. Keeping the operators together // causes them to be assigned integer values that are close together, |
︙ | ︙ | |||
754 755 756 757 758 759 760 | ///////////////////////////// The DROP INDEX command ///////////////////////// // cmd ::= DROP INDEX nm(X) dbnm(Y). { sqlite3DropIndex(pParse, sqlite3SrcListAppend(0,&X,&Y)); } | < < < < < < < < | 754 755 756 757 758 759 760 761 762 763 764 765 766 767 | ///////////////////////////// The DROP INDEX command ///////////////////////// // cmd ::= DROP INDEX nm(X) dbnm(Y). { sqlite3DropIndex(pParse, sqlite3SrcListAppend(0,&X,&Y)); } ///////////////////////////// The VACUUM command ///////////////////////////// // cmd ::= VACUUM. {sqlite3Vacuum(pParse,0);} cmd ::= VACUUM nm(X). {sqlite3Vacuum(pParse,&X);} ///////////////////////////// The PRAGMA command ///////////////////////////// // |
︙ | ︙ |
Changes to src/sqliteInt.h.
1 2 3 4 5 6 7 8 9 10 11 12 13 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** 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. ** ************************************************************************* ** Internal interface definitions for SQLite. ** | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** 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. ** ************************************************************************* ** Internal interface definitions for SQLite. ** ** @(#) $Id: sqliteInt.h,v 1.256 2004/05/27 17:22:56 drh Exp $ */ #include "config.h" #include "sqlite.h" #include "hash.h" #include "parse.h" #include <stdio.h> #include <stdlib.h> |
︙ | ︙ | |||
1240 1241 1242 1243 1244 1245 1246 | int sqlite3ExprCodeExprList(Parse*, ExprList*); void sqlite3ExprIfTrue(Parse*, Expr*, int, int); void sqlite3ExprIfFalse(Parse*, Expr*, int, int); Table *sqlite3FindTable(sqlite*,const char*, const char*); Table *sqlite3LocateTable(Parse*,const char*, const char*); Index *sqlite3FindIndex(sqlite*,const char*, const char*); void sqlite3UnlinkAndDeleteIndex(sqlite*,Index*); | < | 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 | int sqlite3ExprCodeExprList(Parse*, ExprList*); void sqlite3ExprIfTrue(Parse*, Expr*, int, int); void sqlite3ExprIfFalse(Parse*, Expr*, int, int); Table *sqlite3FindTable(sqlite*,const char*, const char*); Table *sqlite3LocateTable(Parse*,const char*, const char*); Index *sqlite3FindIndex(sqlite*,const char*, const char*); void sqlite3UnlinkAndDeleteIndex(sqlite*,Index*); void sqlite3Vacuum(Parse*, Token*); int sqlite3RunVacuum(char**, sqlite*); int sqlite3GlobCompare(const unsigned char*,const unsigned char*); int sqlite3LikeCompare(const unsigned char*,const unsigned char*); char *sqlite3TableNameFromToken(Token*); int sqlite3ExprCheck(Parse*, Expr*, int, int*); int sqlite3ExprType(Expr*); |
︙ | ︙ |
Changes to src/tokenize.c.
︙ | ︙ | |||
11 12 13 14 15 16 17 | ************************************************************************* ** An tokenizer for SQL ** ** This file contains C code that splits an SQL input string up into ** individual tokens and sends those tokens one-by-one over to the ** parser for analysis. ** | | | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ************************************************************************* ** An tokenizer for SQL ** ** This file contains C code that splits an SQL input string up into ** individual tokens and sends those tokens one-by-one over to the ** parser for analysis. ** ** $Id: tokenize.c,v 1.73 2004/05/27 17:22:56 drh Exp $ */ #include "sqliteInt.h" #include "os.h" #include <ctype.h> #include <stdlib.h> /* |
︙ | ︙ | |||
53 54 55 56 57 58 59 | { "CASE", TK_CASE, }, { "CHECK", TK_CHECK, }, { "CLUSTER", TK_CLUSTER, }, { "COLLATE", TK_COLLATE, }, { "COMMIT", TK_COMMIT, }, { "CONFLICT", TK_CONFLICT, }, { "CONSTRAINT", TK_CONSTRAINT, }, | < < | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | { "CASE", TK_CASE, }, { "CHECK", TK_CHECK, }, { "CLUSTER", TK_CLUSTER, }, { "COLLATE", TK_COLLATE, }, { "COMMIT", TK_COMMIT, }, { "CONFLICT", TK_CONFLICT, }, { "CONSTRAINT", TK_CONSTRAINT, }, { "CREATE", TK_CREATE, }, { "CROSS", TK_JOIN_KW, }, { "DATABASE", TK_DATABASE, }, { "DEFAULT", TK_DEFAULT, }, { "DEFERRED", TK_DEFERRED, }, { "DEFERRABLE", TK_DEFERRABLE, }, { "DELETE", TK_DELETE, }, { "DESC", TK_DESC, }, { "DETACH", TK_DETACH, }, { "DISTINCT", TK_DISTINCT, }, { "DROP", TK_DROP, }, { "END", TK_END, }, { "EACH", TK_EACH, }, { "ELSE", TK_ELSE, }, |
︙ | ︙ | |||
692 693 694 695 696 697 698 | } } state = trans[state][token]; zSql++; } return state==0; } | < < < | 690 691 692 693 694 695 696 | } } state = trans[state][token]; zSql++; } return state==0; } |
Changes to src/vdbe.c.
︙ | ︙ | |||
39 40 41 42 43 44 45 | ** ** 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. ** | | | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | ** ** 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.340 2004/05/27 17:22:56 drh Exp $ */ #include "sqliteInt.h" #include "os.h" #include <ctype.h> #include "vdbeInt.h" /* |
︙ | ︙ | |||
4244 4245 4246 4247 4248 4249 4250 | /* Opcode: SortReset * * * ** ** Remove any elements that remain on the sorter. */ case OP_SortReset: { sqlite3VdbeSorterReset(p); | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 | /* Opcode: SortReset * * * ** ** Remove any elements that remain on the sorter. */ case OP_SortReset: { sqlite3VdbeSorterReset(p); break; } /* Opcode: MemStore P1 P2 * ** ** Write the top of the stack into memory location P1. ** P1 should be a small integer since space is allocated |
︙ | ︙ |
Changes to test/auth.test.
︙ | ︙ | |||
8 9 10 11 12 13 14 | # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is testing the ATTACH and DETACH commands # and related functionality. # | | | 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. The # focus of this script is testing the ATTACH and DETACH commands # and related functionality. # # $Id: auth.test,v 1.13 2004/05/27 17:22:56 drh Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl # disable this test if the SQLITE_OMIT_AUTHORIZATION macro is # defined during compilation. |
︙ | ︙ | |||
413 414 415 416 417 418 419 | return SQLITE_OK } return SQLITE_OK } catchsql {SELECT * FROM t2} } {0 {11 2 33}} | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 413 414 415 416 417 418 419 420 421 422 423 424 425 426 | return SQLITE_OK } return SQLITE_OK } catchsql {SELECT * FROM t2} } {0 {11 2 33}} do_test auth-1.63 { proc auth {code arg1 arg2 arg3 arg4} { if {$code=="SQLITE_DELETE" && $arg1=="sqlite_master"} { return SQLITE_DENY } return SQLITE_OK |
︙ | ︙ |
Deleted test/copy.test.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to test/delete.test.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # 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. The # focus of this file is testing the DELETE FROM statement. # | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # 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. The # focus of this file is testing the DELETE FROM statement. # # $Id: delete.test,v 1.14 2004/05/27 17:22:56 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Try to delete from a non-existant table. # do_test delete-1.1 { |
︙ | ︙ | |||
148 149 150 151 152 153 154 | integrity_check delete-5.8 # Delete large quantities of data. We want to test the List overflow # mechanism in the vdbe. # do_test delete-6.1 { | | | < | < > | > | < | 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | integrity_check delete-5.8 # Delete large quantities of data. We want to test the List overflow # mechanism in the vdbe. # do_test delete-6.1 { execsql {BEGIN; DELETE FROM table1} for {set i 1} {$i<=3000} {incr i} { execsql "INSERT INTO table1 VALUES($i,[expr {$i*$i}])" } execsql {DELETE FROM table2} for {set i 1} {$i<=3000} {incr i} { execsql "INSERT INTO table2 VALUES($i,[expr {$i*$i}])" } execsql {COMMIT} execsql {SELECT count(*) FROM table1} } {3000} do_test delete-6.2 { execsql {SELECT count(*) FROM table2} } {3000} do_test delete-6.3 { execsql {SELECT f1 FROM table1 WHERE f1<10 ORDER BY f1} |
︙ | ︙ |
Changes to test/enc2.test.
︙ | ︙ | |||
9 10 11 12 13 14 15 | # #*********************************************************************** # This file implements regression tests for SQLite library. The focus of # this file is testing the SQLite routines used for converting between the # various suported unicode encodings (UTF-8, UTF-16, UTF-16le and # UTF-16be). # | | | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # #*********************************************************************** # This file implements regression tests for SQLite library. The focus of # this file is testing the SQLite routines used for converting between the # various suported unicode encodings (UTF-8, UTF-16, UTF-16le and # UTF-16be). # # $Id: enc2.test,v 1.4 2004/05/27 17:22:56 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl db close # Return the UTF-8 representation of the supplied UTF-16 string $str. |
︙ | ︙ | |||
55 56 57 58 59 60 61 | # Insert some data do_test $t.2 { execsql {INSERT INTO t1 VALUES('two', 'II', 2);} execsql {SELECT * FROM t1} } {one I 1 two II 2} | | < < < < < | > > > > | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | # Insert some data do_test $t.2 { execsql {INSERT INTO t1 VALUES('two', 'II', 2);} execsql {SELECT * FROM t1} } {one I 1 two II 2} # Insert some data do_test $t.3 { execsql { INSERT INTO t1 VALUES('three','III',3); INSERT INTO t1 VALUES('four','IV',4); INSERT INTO t1 VALUES('five','V',5); } execsql {SELECT * FROM t1} } {one I 1 two II 2 three III 3 four IV 4 five V 5} # Use the index do_test $t.4 { execsql { SELECT * FROM t1 WHERE a = 'one'; |
︙ | ︙ |
Deleted test/format3.test.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to test/in.test.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # 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. The # focus of this file is testing the IN and BETWEEN operator. # | | | > > > | < < > | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # 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. The # focus of this file is testing the IN and BETWEEN operator. # # $Id: in.test,v 1.12 2004/05/27 17:22:56 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Generate the test data we will need for the first squences of tests. # do_test in-1.0 { execsql { BEGIN; CREATE TABLE t1(a int, b int); } for {set i 1} {$i<=10} {incr i} { execsql "INSERT INTO t1 VALUES($i,[expr {int(pow(2,$i))}])" } execsql { COMMIT; SELECT count(*) FROM t1; } } {10} # Do basic testing of BETWEEN. # do_test in-1.1 { execsql {SELECT a FROM t1 WHERE b BETWEEN 10 AND 50 ORDER BY a} } {4 5} |
︙ | ︙ |
Changes to test/intpkey.test.
︙ | ︙ | |||
9 10 11 12 13 14 15 | # #*********************************************************************** # This file implements regression tests for SQLite library. # # This file implements tests for the special processing associated # with INTEGER PRIMARY KEY columns. # | | | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # #*********************************************************************** # 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.15 2004/05/27 17:22:56 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a table with a primary key and a datatype other than # integer # |
︙ | ︙ | |||
376 377 378 379 380 381 382 383 | SELECT rowid, a FROM t1 } } {-4 -4 0 0 5 5 6 6 11 11} # Test the ability of the COPY command to put data into a # table that contains an integer primary key. # do_test intpkey-6.1 { | > > > < < < < < > | > > > | 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | SELECT rowid, a FROM t1 } } {-4 -4 0 0 5 5 6 6 11 11} # Test the ability of the COPY command to put data into a # table that contains an integer primary key. # # COPY command has been removed. But we retain these tests so # that the tables will contain the right data for tests that follow. # do_test intpkey-6.1 { execsql { BEGIN; INSERT INTO t1 VALUES(20,'b-20','c-20'); INSERT INTO t1 VALUES(21,'b-21','c-21'); INSERT INTO t1 VALUES(22,'b-22','c-22'); COMMIT; SELECT * FROM t1 WHERE a>=20; } } {20 b-20 c-20 21 b-21 c-21 22 b-22 c-22} do_test intpkey-6.2 { execsql { SELECT * FROM t1 WHERE b=='hello' } |
︙ | ︙ |
Changes to test/limit.test.
︙ | ︙ | |||
8 9 10 11 12 13 14 | # 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 LIMIT ... OFFSET ... clause # of SELECT statements. # | | | > > > | < < | < | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | # 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 LIMIT ... OFFSET ... clause # of SELECT statements. # # $Id: limit.test,v 1.13 2004/05/27 17:22:56 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Build some test data # execsql { CREATE TABLE t1(x int, y int); BEGIN; } for {set i 1} {$i<=32} {incr i} { for {set j 0} {pow(2,$j)<$i} {incr j} {} execsql "INSERT INTO t1 VALUES([expr {32-$i}],[expr {10-$j}])" } execsql { COMMIT; } do_test limit-1.0 { execsql {SELECT count(*) FROM t1} } {32} do_test limit-1.1 { execsql {SELECT count(*) FROM t1 LIMIT 5} } {32} |
︙ | ︙ |
Changes to test/malloc.test.
︙ | ︙ | |||
10 11 12 13 14 15 16 | #*********************************************************************** # This file attempts to check the library in an out-of-memory situation. # When compiled with -DMEMORY_DEBUG=1, the SQLite library accepts a special # command (sqlite_malloc_fail N) which causes the N-th malloc to fail. This # special feature is used to see what happens in the library if a malloc # were to really fail due to an out-of-memory situation. # | | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #*********************************************************************** # This file attempts to check the library in an out-of-memory situation. # When compiled with -DMEMORY_DEBUG=1, the SQLite library accepts a special # command (sqlite_malloc_fail N) which causes the N-th malloc to fail. This # special feature is used to see what happens in the library if a malloc # were to really fail due to an out-of-memory situation. # # $Id: malloc.test,v 1.7 2004/05/27 17:22:56 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Only run these tests if memory debugging is turned on. # if {[info command sqlite_malloc_stat]==""} { |
︙ | ︙ | |||
63 64 65 66 67 68 69 | lappend v $v2 } } {1 1} } set fd [open ./data.tmp w] for {set i 1} {$i<=20} {incr i} { | | | > > > > > | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | lappend v $v2 } } {1 1} } set fd [open ./data.tmp w] for {set i 1} {$i<=20} {incr i} { puts $fd "$i\t[expr {$i*$i}]\t[expr {100-$i}] abcdefghijklmnopqrstuvwxyz" } close $fd for {set go 1; set i 1} {$go} {incr i} { do_test malloc-2.$i { sqlite_malloc_fail 0 catch {db close} catch {file delete -force test.db} catch {file delete -force test.db-journal} sqlite_malloc_fail $i set v [catch {sqlite db test.db} msg] if {$v} { set msg "" } else { set v [catch {execsql { CREATE TABLE t1(a int, b int, c int); CREATE INDEX i1 ON t1(a,b); INSERT INTO t1 VALUES(1,1,'99 abcdefghijklmnopqrstuvwxyz'); INSERT INTO t1 VALUES(2,4,'98 abcdefghijklmnopqrstuvwxyz'); INSERT INTO t1 VALUES(3,9,'97 abcdefghijklmnopqrstuvwxyz'); INSERT INTO t1 VALUES(4,16,'96 abcdefghijklmnopqrstuvwxyz'); INSERT INTO t1 VALUES(5,25,'95 abcdefghijklmnopqrstuvwxyz'); INSERT INTO t1 VALUES(6,36,'94 abcdefghijklmnopqrstuvwxyz'); SELECT 'stuff', count(*) as 'other stuff', max(a+10) FROM t1; UPDATE t1 SET b=b||b||b||b; UPDATE t1 SET b=a WHERE a in (10,12,22); INSERT INTO t1(c,b,a) VALUES(20,10,5); INSERT INTO t1 SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE a<10); DELETE FROM t1 WHERE a>=10; |
︙ | ︙ | |||
106 107 108 109 110 111 112 | set v2 [expr {$msg=="" || $msg=="out of memory"}] if {!$v2} {puts "\nError message returned: $msg"} lappend v $v2 } } {1 1} } | < < < < < < | > > > > > | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | set v2 [expr {$msg=="" || $msg=="out of memory"}] if {!$v2} {puts "\nError message returned: $msg"} lappend v $v2 } } {1 1} } for {set go 1; set i 1} {$go} {incr i} { do_test malloc-3.$i { sqlite_malloc_fail 0 catch {db close} catch {file delete -force test.db} catch {file delete -force test.db-journal} sqlite_malloc_fail $i set v [catch {sqlite db test.db} msg] if {$v} { set msg "" } else { set v [catch {execsql { BEGIN TRANSACTION; CREATE TABLE t1(a int, b int, c int); CREATE INDEX i1 ON t1(a,b); INSERT INTO t1 VALUES(1,1,99); INSERT INTO t1 VALUES(2,4,98); INSERT INTO t1 VALUES(3,9,97); INSERT INTO t1 VALUES(4,16,96); INSERT INTO t1 VALUES(5,25,95); INSERT INTO t1 VALUES(6,36,94); INSERT INTO t1(c,b,a) VALUES(20,10,5); DELETE FROM t1 WHERE a>=10; DROP INDEX i1; DELETE FROM t1; ROLLBACK; }} msg] } |
︙ | ︙ | |||
162 163 164 165 166 167 168 | if {$v} { set msg "" } else { set v [catch {execsql { BEGIN TRANSACTION; CREATE TABLE t1(a int, b int, c int); CREATE INDEX i1 ON t1(a,b); | | > > > > > | 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | if {$v} { set msg "" } else { set v [catch {execsql { BEGIN TRANSACTION; CREATE TABLE t1(a int, b int, c int); CREATE INDEX i1 ON t1(a,b); INSERT INTO t1 VALUES(1,1,99); INSERT INTO t1 VALUES(2,4,98); INSERT INTO t1 VALUES(3,9,97); INSERT INTO t1 VALUES(4,16,96); INSERT INTO t1 VALUES(5,25,95); INSERT INTO t1 VALUES(6,36,94); UPDATE t1 SET b=a WHERE a in (10,12,22); INSERT INTO t1 SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE a<10); DROP INDEX i1; DELETE FROM t1; COMMIT; }} msg] |
︙ | ︙ |
Changes to test/select2.test.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # 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. The # focus of this file is testing the SELECT statement. # | | | | < | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # 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. The # focus of this file is testing the SELECT statement. # # $Id: select2.test,v 1.21 2004/05/27 17:22:56 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a table with some data # execsql {CREATE TABLE tbl1(f1 int, f2 int)} execsql {BEGIN} for {set i 0} {$i<=30} {incr i} { execsql "INSERT INTO tbl1 VALUES([expr {$i%9}],[expr {$i%10}])" } execsql {COMMIT} # Do a second query inside a first. # do_test select2-1.1 { set sql {SELECT DISTINCT f1 FROM tbl1 ORDER BY f1} set r {} db eval $sql data { |
︙ | ︙ | |||
57 58 59 60 61 62 63 | } set r } {4: 2 3 4} # Create a largish table # do_test select2-2.0 { | | < | < < | < | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | } set r } {4: 2 3 4} # Create a largish table # do_test select2-2.0 { execsql {CREATE TABLE tbl2(f1 int, f2 int, f3 int); BEGIN;} for {set i 1} {$i<=30000} {incr i} { execsql "INSERT INTO tbl2 VALUES($i,[expr {$i*2}],[expr {$i*3}])" } execsql {COMMIT} } {} do_test select2-2.1 { execsql {SELECT count(*) FROM tbl2} } {30000} do_test select2-2.2 { execsql {SELECT count(*) FROM tbl2 WHERE f2>1000} |
︙ | ︙ |
Changes to test/select3.test.
︙ | ︙ | |||
8 9 10 11 12 13 14 | # 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 aggregate functions and the # GROUP BY and HAVING clauses of SELECT statements. # | | | > > > < > < < | < | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | # 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 aggregate functions and the # GROUP BY and HAVING clauses of SELECT statements. # # $Id: select3.test,v 1.10 2004/05/27 17:22:56 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Build some test data # do_test select3-1.0 { execsql { CREATE TABLE t1(n int, log int); BEGIN; } for {set i 1} {$i<32} {incr i} { for {set j 0} {pow(2,$j)<$i} {incr j} {} execsql "INSERT INTO t1 VALUES($i,$j)" } execsql { COMMIT } execsql {SELECT DISTINCT log FROM t1 ORDER BY log} } {0 1 2 3 4 5} # Basic aggregate functions. # do_test select3-1.1 { execsql {SELECT count(*) FROM t1} |
︙ | ︙ |
Changes to test/select4.test.
︙ | ︙ | |||
8 9 10 11 12 13 14 | # 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 UNION, INTERSECT and EXCEPT operators # in SELECT statements. # | | | > > > < > < < | < | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | # 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 UNION, INTERSECT and EXCEPT operators # in SELECT statements. # # $Id: select4.test,v 1.16 2004/05/27 17:22:56 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Build some test data # execsql { CREATE TABLE t1(n int, log int); BEGIN; } for {set i 1} {$i<32} {incr i} { for {set j 0} {pow(2,$j)<$i} {incr j} {} execsql "INSERT INTO t1 VALUES($i,$j)" } execsql { COMMIT; } do_test select4-1.0 { execsql {SELECT DISTINCT log FROM t1 ORDER BY log} } {0 1 2 3 4 5} # Union All operator # |
︙ | ︙ |
Changes to test/select5.test.
︙ | ︙ | |||
8 9 10 11 12 13 14 | # 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 aggregate functions and the # GROUP BY and HAVING clauses of SELECT statements. # | | | > > > | < < | < | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | # 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 aggregate functions and the # GROUP BY and HAVING clauses of SELECT statements. # # $Id: select5.test,v 1.7 2004/05/27 17:22:56 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Build some test data # execsql { CREATE TABLE t1(x int, y int); BEGIN; } for {set i 1} {$i<32} {incr i} { for {set j 0} {pow(2,$j)<$i} {incr j} {} execsql "INSERT INTO t1 VALUES([expr {32-$i}],[expr {10-$j}])" } execsql { COMMIT } do_test select5-1.0 { execsql {SELECT DISTINCT y FROM t1 ORDER BY y} } {5 6 7 8 9 10} # Sort by an aggregate function. # |
︙ | ︙ |
Changes to test/sort.test.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # 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. The # focus of this file is testing the CREATE TABLE statement. # | | < < < < < < < < < < > | > > > > > > < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # 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. The # focus of this file is testing the CREATE TABLE statement. # # $Id: sort.test,v 1.12 2004/05/27 17:22:56 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a bunch of data to sort against # do_test sort-1.0 { execsql { CREATE TABLE t1( n int, v varchar(10), log int, roman varchar(10), flt real ); INSERT INTO t1 VALUES(1,'one',0,'I',3.141592653); INSERT INTO t1 VALUES(2,'two',1,'II',2.15); INSERT INTO t1 VALUES(3,'three',1,'III',4221.0); INSERT INTO t1 VALUES(4,'four',2,'IV',-0.0013442); INSERT INTO t1 VALUES(5,'five',2,'V',-11); INSERT INTO t1 VALUES(6,'six',2,'VI',0.123); INSERT INTO t1 VALUES(7,'seven',2,'VII',123.0); INSERT INTO t1 VALUES(8,'eight',3,'VIII',-1.6); } execsql {SELECT count(*) FROM t1} } {8} do_test sort-1.1 { execsql {SELECT n FROM t1 ORDER BY n} } {1 2 3 4 5 6 7 8} do_test sort-1.1.1 { |
︙ | ︙ |