From: drh Date: Tue, 11 Jul 2006 14:17:51 +0000 (+0000) Subject: By default, new databases are now created in the legacy file format - the X-Git-Tag: version-3.6.10~2837 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76fe8032c1ca7bdc904188c1dd4059189f459404;p=thirdparty%2Fsqlite.git By default, new databases are now created in the legacy file format - the format that ignores DESC on indices. If you want descending indices, you must either recompile with -DSQLITE_DEFAULT_FILE_FORMAT=4 or issue "PRAGMA legacy_file_format=OFF" prior to creating the first table in the database. (CVS 3330) FossilOrigin-Name: 65b60f05ce49ff127bf5044f96db36caf1fa0106 --- diff --git a/manifest b/manifest index e9d8df1f36..a583c0339d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Prevent\smemory\sleak\sand\spossible\sNULL\spointer\sdeference\safter\smalloc\nfailure.\s\sTicket\s#1886.\s(CVS\s3329) -D 2006-07-11T13:15:08 +C By\sdefault,\snew\sdatabases\sare\snow\screated\sin\sthe\slegacy\sfile\sformat\s-\sthe\nformat\sthat\signores\sDESC\son\sindices.\s\sIf\syou\swant\sdescending\sindices,\syou\nmust\seither\srecompile\swith\s-DSQLITE_DEFAULT_FILE_FORMAT=4\sor\sissue\n"PRAGMA\slegacy_file_format=OFF"\sprior\sto\screating\sthe\sfirst\stable\sin\sthe\ndatabase.\s(CVS\s3330) +D 2006-07-11T14:17:52 F Makefile.in 9c2a76055c305868cc5f5b73e29a252ff3632c0a F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -36,7 +36,7 @@ F src/attach.c b11eb4d5d3fb99a10a626956bccc7215f6b68b16 F src/auth.c 902f4722661c796b97f007d9606bd7529c02597f F src/btree.c fc077741b35efd2015b0f56e62d00370bed1fcc8 F src/btree.h 061c50e37de7f50b58528e352d400cf33ead7418 -F src/build.c ef710ff6b3a91d4c1dd4c7009a8800ff38660613 +F src/build.c b5eb033a663798af85735392bea73f9bd3b16e8a F src/callback.c fd9bb39f7ff6b52bad8365617abc61c720640429 F src/complete.c 7d1a44be8f37de125fcafd3d3a018690b3799675 F src/date.c cd2bd5d1ebc6fa12d6312f69789ae5b0a2766f2e @@ -49,7 +49,7 @@ F src/hash.h 1b3f7e2609141fd571f62199fc38687d262e9564 F src/insert.c 63f01d3f4e0ba7ed171934a24aece2191824faec F src/legacy.c 10e01a902d7f2c872c7922fedf19a2df70935857 F src/loadext.c 040853b36adf535bba6a2e9f5d921422a4394baf -F src/main.c be8cb8af8f7c8234e30341e96a1dd9414b5ce73f +F src/main.c 14937db8a0c383598f1901fcc308cf9126ef62ae F src/md5.c c5fdfa5c2593eaee2e32a5ce6c6927c986eaf217 F src/os.c 59f05de8c5777c34876607114a2fbe55ae578235 F src/os.h 3fd6a022bafd620fdfd779a51dccb42f31c97f75 @@ -74,7 +74,7 @@ F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96 F src/shell.c 359551ab5cdd8f8fe5f3fe170fd330b108b08d7d F src/sqlite.h.in 432848ac7f8d7e6fea727668acccec62bdd86cc4 F src/sqlite3ext.h c611255287e9a11ce4f1fe6251c2a0b9d32a828b -F src/sqliteInt.h 5a485f340533da2baa56ff1ceb9c101726062150 +F src/sqliteInt.h a413094c83dd3e79f129afb9d453b5680651176b F src/table.c d8817f43a6c6bf139487db161760b9e1e02da3f1 F src/tclsqlite.c 22ab598cfaa6fda50dec9035852687114286d06e F src/test1.c 535294d7f21a4127082c4f7a57f225482df9cc36 @@ -163,9 +163,9 @@ F test/default.test 252298e42a680146b1dd64f563b95bdf088d94fb F test/delete.test 525a6953bc3978780cae35f3eaf1027cf4ce887d F test/delete2.test d20b08733243f1890079f3b48f2356fbb62212b2 F test/delete3.test 555e84a00a99230b7d049d477a324a631126a6ab -F test/descidx1.test 514e84d56ddeb455081d7a43fa1e5ec7cbc164c2 -F test/descidx2.test ab9153ac0dc27268a2e42b746be13bf48388e762 -F test/descidx3.test 443dfeafab55e8ae88cfc45e02d8edb90d439810 +F test/descidx1.test 2177c4ad55edcf56ad5f4c6490f307d7774e8a10 +F test/descidx2.test eb3a2882ec58aa6e1e8131d9bb54436e5b4a3ce2 +F test/descidx3.test 3a55b8d73bc3e9ad084e0da7fec781cf0d2a0356 F test/diskfull.test d828d72adfc9e2d1a194d25996718c1989152cf9 F test/distinctagg.test 2b89d1c5220d966a30ba4b40430338669301188b F test/enc.test 7a03417a1051fe8bc6c7641cf4c8c3f7e0066d52 @@ -173,7 +173,7 @@ F test/enc2.test 9f15cb7adc745fbb93d083ae1cf5a2deaa04d25f F test/enc3.test 890508efff6677345e93bf2a8adb0489b30df030 F test/expr.test 7b4b349abdb05ab1862c1cfcf7607e3731efc5d2 F test/fkey1.test 153004438d51e6769fb1ce165f6313972d6263ce -F test/format4.test ddb875c0d423bb3fbe923d2ba89773d4afb5c46a +F test/format4.test bf3bed3b13c63abfb3cfec232597a319a31d0bcc F test/func.test c0df82c29f07b8b6ee0aaa13950f43880f8046bf F test/hook.test 7e7645fd9a033f79cce8fdff151e32715e7ec50a F test/in.test 369cb2aa1eab02296b4ec470732fe8c131260b1d @@ -375,7 +375,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P eb91612f4646b15c2b8398c5225669419b03b531 -R ad854be3689dac4985748c7dc8520e06 +P b1f326e6959ef3be11f772e80f5ab6dd65b2d065 +R 58e2d2587eb65892cff29cb33e8999b9 U drh -Z f6315bc4dfdd75362a9c8ec6860ea002 +Z 77fa0dc9a6a18dc5ba3c3f9cbd7ca1bb diff --git a/manifest.uuid b/manifest.uuid index 65580e4416..f285292b8b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b1f326e6959ef3be11f772e80f5ab6dd65b2d065 \ No newline at end of file +65b60f05ce49ff127bf5044f96db36caf1fa0106 \ No newline at end of file diff --git a/src/build.c b/src/build.c index df9015ff32..66bead5cfd 100644 --- a/src/build.c +++ b/src/build.c @@ -22,7 +22,7 @@ ** COMMIT ** ROLLBACK ** -** $Id: build.c,v 1.407 2006/06/21 12:36:25 danielk1977 Exp $ +** $Id: build.c,v 1.408 2006/07/11 14:17:52 drh Exp $ */ #include "sqliteInt.h" #include @@ -854,7 +854,7 @@ void sqlite3StartTable( lbl = sqlite3VdbeMakeLabel(v); sqlite3VdbeAddOp(v, OP_If, 0, lbl); fileFormat = (db->flags & SQLITE_LegacyFileFmt)!=0 ? - 1 : SQLITE_DEFAULT_FILE_FORMAT; + 1 : SQLITE_MAX_FILE_FORMAT; sqlite3VdbeAddOp(v, OP_Integer, fileFormat, 0); sqlite3VdbeAddOp(v, OP_SetCookie, iDb, 1); sqlite3VdbeAddOp(v, OP_Integer, ENC(db), 0); diff --git a/src/main.c b/src/main.c index dc42a82709..72d1a7abbc 100644 --- a/src/main.c +++ b/src/main.c @@ -14,7 +14,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: main.c,v 1.351 2006/07/06 10:59:58 drh Exp $ +** $Id: main.c,v 1.352 2006/07/11 14:17:52 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -845,7 +845,11 @@ static int openDatabase( db->nDb = 2; db->aDb = db->aDbStatic; db->autoCommit = 1; - db->flags |= SQLITE_ShortColNames; + db->flags |= SQLITE_ShortColNames +#if SQLITE_DEFAULT_FILE_FORMAT<4 + | SQLITE_LegacyFileFmt +#endif + ; sqlite3HashInit(&db->aFunc, SQLITE_HASH_STRING, 0); sqlite3HashInit(&db->aCollSeq, SQLITE_HASH_STRING, 0); #ifndef SQLITE_OMIT_VIRTUALTABLE diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 360c69cdc4..145fab2d06 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -11,7 +11,7 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.520 2006/07/11 13:15:08 drh Exp $ +** @(#) $Id: sqliteInt.h,v 1.521 2006/07/11 14:17:52 drh Exp $ */ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ @@ -148,7 +148,7 @@ */ #define SQLITE_MAX_FILE_FORMAT 4 #ifndef SQLITE_DEFAULT_FILE_FORMAT -# define SQLITE_DEFAULT_FILE_FORMAT 4 +# define SQLITE_DEFAULT_FILE_FORMAT 1 #endif /* diff --git a/test/descidx1.test b/test/descidx1.test index 567864485b..9c26b7f5df 100644 --- a/test/descidx1.test +++ b/test/descidx1.test @@ -11,16 +11,13 @@ # This file implements regression tests for SQLite library. The # focus of this script is descending indices. # -# $Id: descidx1.test,v 1.6 2006/06/27 12:51:13 drh Exp $ +# $Id: descidx1.test,v 1.7 2006/07/11 14:17:52 drh Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl -ifcapable legacyformat { - finish_test - return -} +db eval {PRAGMA legacy_file_format=OFF} # This procedure sets the value of the file-format in file 'test.db' # to $newval. Also, the schema cookie is incremented. @@ -297,12 +294,21 @@ do_test descidx1-5.9 { # Test the legacy_file_format pragma here because we have access to # the get_file_format command. # -do_test descidx1-6.1 { - db close - file delete -force test.db test.db-journal - sqlite3 db test.db - execsql {PRAGMA legacy_file_format} -} {0} +ifcapable legacyformat { + do_test descidx1-6.1 { + db close + file delete -force test.db test.db-journal + sqlite3 db test.db + execsql {PRAGMA legacy_file_format} + } {1} +} else { + do_test descidx1-6.1 { + db close + file delete -force test.db test.db-journal + sqlite3 db test.db + execsql {PRAGMA legacy_file_format} + } {0} +} do_test descidx1-6.2 { execsql {PRAGMA legacy_file_format=YES} execsql {PRAGMA legacy_file_format} @@ -313,6 +319,19 @@ do_test descidx1-6.3 { } get_file_format } {1} +do_test descidx1-6.4 { + db close + file delete -force test.db test.db-journal + sqlite3 db test.db + execsql {PRAGMA legacy_file_format=NO} + execsql {PRAGMA legacy_file_format} +} {0} +do_test descidx1-6.5 { + execsql { + CREATE TABLE t1(a,b,c); + } + get_file_format +} {4} finish_test diff --git a/test/descidx2.test b/test/descidx2.test index 0b7720666c..3c6b392b1f 100644 --- a/test/descidx2.test +++ b/test/descidx2.test @@ -11,16 +11,13 @@ # This file implements regression tests for SQLite library. The # focus of this script is descending indices. # -# $Id: descidx2.test,v 1.3 2006/06/27 12:51:13 drh Exp $ +# $Id: descidx2.test,v 1.4 2006/07/11 14:17:52 drh Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl -ifcapable legacyformat { - finish_test - return -} +db eval {PRAGMA legacy_file_format=OFF} # This procedure sets the value of the file-format in file 'test.db' # to $newval. Also, the schema cookie is incremented. diff --git a/test/descidx3.test b/test/descidx3.test index 54bb00574c..98b60e6de3 100644 --- a/test/descidx3.test +++ b/test/descidx3.test @@ -11,16 +11,17 @@ # This file implements regression tests for SQLite library. The # focus of this script is descending indices. # -# $Id: descidx3.test,v 1.4 2006/06/27 12:51:13 drh Exp $ +# $Id: descidx3.test,v 1.5 2006/07/11 14:17:52 drh Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl -ifcapable {!bloblit || legacyformat} { +ifcapable !bloblit { finish_test return } +db eval {PRAGMA legacy_file_format=OFF} # This procedure sets the value of the file-format in file 'test.db' # to $newval. Also, the schema cookie is incremented. diff --git a/test/format4.test b/test/format4.test index 51cb2fe1c2..61c9616b1d 100644 --- a/test/format4.test +++ b/test/format4.test @@ -17,10 +17,7 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl -ifcapable legacyformat { - finish_test - return -} +db eval {PRAGMA legacy_file_format=OFF} # The size of the database depends on whether or not autovacuum # is enabled.