]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Allow the journal_size_limit to be larger than 2147483647 bytes. (CVS 6449)
authordrh <drh@noemail.net>
Sat, 4 Apr 2009 16:02:32 +0000 (16:02 +0000)
committerdrh <drh@noemail.net>
Sat, 4 Apr 2009 16:02:32 +0000 (16:02 +0000)
FossilOrigin-Name: 81931259611ef10de731ea0e38cee92eb8629733

manifest
manifest.uuid
src/pragma.c
test/jrnlmode.test

index 63ed075a002f8e5a02141daeb8648b6131efa315..ede507e232a0c33a61fcd6e64730b1f3e7b91d0d 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Allow\sthe\sjournal_mode\sfor\sin-memory\sdatabases\sto\sbe\seither\sOFF\sor\sMEMORY,\nnot\sjust\sMEMORY.\s(CVS\s6448)
-D 2009-04-04T15:53:48
+C Allow\sthe\sjournal_size_limit\sto\sbe\slarger\sthan\s2147483647\sbytes.\s(CVS\s6449)
+D 2009-04-04T16:02:32
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -149,7 +149,7 @@ F src/parse.y 070215cf461ab917c23253a9cbf0903f2b0d8f19
 F src/pcache.c 395f752a13574120bd7513a400ba02a265aaa76d
 F src/pcache.h 9b927ccc5a538e31b4c3bc7eec4f976db42a1324
 F src/pcache1.c f587565f4ba0fd1772067eaa96814dce761b7a4c
-F src/pragma.c 32a967b5fc314ffed08a7778945592d536b64826
+F src/pragma.c c7a237e4dc3b1fa3d83c7da6a3e2dea8d010a0b7
 F src/prepare.c 0ad1ba3290e0626aa4e7589ed6ab6af2572875b0
 F src/printf.c 9866a9a9c4a90f6d4147407f373df3fd5d5f9b6f
 F src/random.c 676b9d7ac820fe81e6fb2394ac8c10cff7f38628
@@ -420,7 +420,7 @@ F test/join3.test 6f0c774ff1ba0489e6c88a3e77b9d3528fb4fda0
 F test/join4.test 1a352e4e267114444c29266ce79e941af5885916
 F test/join5.test 86675fc2919269aa923c84dd00ee4249b97990fe
 F test/journal1.test 36f2d1bb9bf03f790f43fbdb439e44c0657fab19
-F test/jrnlmode.test 32e79fa272e78ff3b734aac08db886f98f84165a
+F test/jrnlmode.test 887daf941f3b03f8a19b4bf8fc603c51c1ea37ff
 F test/jrnlmode2.test bd846e10d463c0b6f8bded674cb07f94a0277097
 F test/keyword1.test a2400977a2e4fde43bf33754c2929fda34dbca05
 F test/lastinsert.test 474d519c68cb79d07ecae56a763aa7f322c72f51
@@ -715,7 +715,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P c47aeb37a1c054a8e0444b95e29cb332599af2d8
-R ae3e14723e90d8a65d36e9ebea09a9ef
+P 11c77f4c2c2beee5267ea6e2f1a4bb845531b42c
+R 6fa763bbfd08cb93ca1062548d8a5a81
 U drh
-Z 073192898ad0af334ccc18150893fe50
+Z 3ec086d0c80add1adc32688c8dbd85a1
index 9676af87416ec9b7b8a46b0dfe78a7bf3df33601..f4510cf5445536efa357c247ea07cb3e87925f19 100644 (file)
@@ -1 +1 @@
-11c77f4c2c2beee5267ea6e2f1a4bb845531b42c
\ No newline at end of file
+81931259611ef10de731ea0e38cee92eb8629733
\ No newline at end of file
index e6677d33ba46db88e304fa471d2da7ec8fd6d164..c8768b07d108c1a5802653084ea0304c4a5db777 100644 (file)
@@ -11,7 +11,7 @@
 *************************************************************************
 ** This file contains code used to implement the PRAGMA command.
 **
-** $Id: pragma.c,v 1.205 2009/04/02 20:16:59 drh Exp $
+** $Id: pragma.c,v 1.206 2009/04/04 16:02:32 drh Exp $
 */
 #include "sqliteInt.h"
 
@@ -144,10 +144,14 @@ static int changeTempStorage(Parse *pParse, const char *zStorageType){
 /*
 ** Generate code to return a single integer value.
 */
-static void returnSingleInt(Parse *pParse, const char *zLabel, int value){
+static void returnSingleInt(Parse *pParse, const char *zLabel, i64 value){
   Vdbe *v = sqlite3GetVdbe(pParse);
   int mem = ++pParse->nMem;
-  sqlite3VdbeAddOp2(v, OP_Integer, value, mem);
+  i64 *pI64 = sqlite3DbMallocRaw(pParse->db, sizeof(value));
+  if( pI64 ){
+    memcpy(pI64, &value, sizeof(value));
+  }
+  sqlite3VdbeAddOp4(v, OP_Int64, 0, mem, 0, (char*)pI64, P4_INT64);
   if( pParse->explain==0 ){
     sqlite3VdbeSetNumCols(v, 1);
     sqlite3VdbeSetColName(v, 0, COLNAME_NAME, zLabel, SQLITE_STATIC);
@@ -531,14 +535,11 @@ void sqlite3Pragma(
     Pager *pPager = sqlite3BtreePager(pDb->pBt);
     i64 iLimit = -2;
     if( zRight ){
-      int iLimit32 = atoi(zRight);
-      if( iLimit32<-1 ){
-        iLimit32 = -1;
-      }
-      iLimit = iLimit32;
+      sqlite3Atoi64(zRight, &iLimit);
+      if( iLimit<-1 ) iLimit = -1;
     }
     iLimit = sqlite3PagerJournalSizeLimit(pPager, iLimit);
-    returnSingleInt(pParse, "journal_size_limit", (int)iLimit);
+    returnSingleInt(pParse, "journal_size_limit", iLimit);
   }else
 
 #endif /* SQLITE_OMIT_PAGER_PRAGMAS */
index 330188adb89395c0cd751583cba01669a7610d00..1c71e9d005ad79ff886a1de10b62c76ce750e6bf 100644 (file)
@@ -11,7 +11,7 @@
 # This file implements regression tests for SQLite library. The focus
 # of these tests is the journal mode pragma.
 #
-# $Id: jrnlmode.test,v 1.12 2009/01/11 05:54:40 danielk1977 Exp $
+# $Id: jrnlmode.test,v 1.13 2009/04/04 16:02:32 drh Exp $
 
 set testdir [file dirname $argv0]
 source $testdir/tester.tcl
@@ -310,7 +310,10 @@ ifcapable pragma {
       PRAGMA aux.journal_size_limit;
     }
   } {-1}
-  do_test jrnlmode-5.4 {
+  do_test jrnlmode-5.4.1 {
+    execsql { PRAGMA aux.journal_size_limit = 999999999999 }
+  } {999999999999}
+  do_test jrnlmode-5.4.2 {
     execsql { PRAGMA aux.journal_size_limit = 10240 }
   } {10240}
   do_test jrnlmode-5.5 {
@@ -484,4 +487,3 @@ ifcapable pragma {
 }
 
 finish_test
-