]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
By default, new databases are now created in the legacy file format - the
authordrh <drh@noemail.net>
Tue, 11 Jul 2006 14:17:51 +0000 (14:17 +0000)
committerdrh <drh@noemail.net>
Tue, 11 Jul 2006 14:17:51 +0000 (14:17 +0000)
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

manifest
manifest.uuid
src/build.c
src/main.c
src/sqliteInt.h
test/descidx1.test
test/descidx2.test
test/descidx3.test
test/format4.test

index e9d8df1f3629382429a59242db737bb2f5ce30f0..a583c0339dddc6e1acf1f57400cf3330f88fcfc1 100644 (file)
--- 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
index 65580e44169bfe75957d66f22bc419f60620d7ae..f285292b8b99fedd354c1280b9e0bfe36155b9b8 100644 (file)
@@ -1 +1 @@
-b1f326e6959ef3be11f772e80f5ab6dd65b2d065
\ No newline at end of file
+65b60f05ce49ff127bf5044f96db36caf1fa0106
\ No newline at end of file
index df9015ff32070c89fe1c2244eed230e354d1d6a0..66bead5cfd1c23769078ab312418859ab5f3ddc5 100644 (file)
@@ -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 <ctype.h>
@@ -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);
index dc42a827095f08bb893251ffefafb20c54ffad18..72d1a7abbc6b71dfc5ef09f3a71f7e11cdea0019 100644 (file)
@@ -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
index 360c69cdc41a70c756d5abc0b324e7fe7d51e430..145fab2d068194ec400caba2c53eb721fd7de7e6 100644 (file)
@@ -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_
 */
 #define SQLITE_MAX_FILE_FORMAT 4
 #ifndef SQLITE_DEFAULT_FILE_FORMAT
-# define SQLITE_DEFAULT_FILE_FORMAT 4
+# define SQLITE_DEFAULT_FILE_FORMAT 1
 #endif
 
 /*
index 567864485bef07639e877c3e4d02d1ff8b3fa438..9c26b7f5df8613d9dbc37360d48493c49335a067 100644 (file)
 # 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
index 0b7720666ceb7a5ebbd13c11ede78060ed757b94..3c6b392b1f7343f208498e90e605c9eaf04bfd2f 100644 (file)
 # 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.
index 54bb00574c5359b8379a54115226c4b000908fec..98b60e6de35f62e1f6a3b6cd87cbbf8fbd9e70e2 100644 (file)
 # 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.
index 51cb2fe1c2e1536600524698df0dd7abe0893c48..61c9616b1dff74d2ca4e4bcc55a04e2161102452 100644 (file)
 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.