Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 92c3b1c203 | |||
| 90e38fde18 | |||
| 733db4c5df | |||
| acea85e6cf | |||
| b54e09173f | |||
| d1a590780b | |||
| 99c0401e5e | |||
| 9f4c890005 | |||
| 68608dc2e8 |
@@ -1,5 +1,8 @@
|
||||
C Version\s3.6.1\s(CVS\s5540)
|
||||
D 2008-08-06T10:50:00
|
||||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA1
|
||||
|
||||
C Keep\sadditional\sstate\sinformation\sin\sthe\spager\sin\san\seffort\sto\sreduce\sthe\nnumber\sof\sSQLITE_FCNTL_SIZE_HINTs.
|
||||
D 2010-05-18T12:37:05
|
||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||
F Makefile.in 2713ea64947be3b35f35d9a3158bb8299c90b019
|
||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||
@@ -90,32 +93,32 @@ F sqlite.pc.in c322c6244c6395955dca34d87955aabde7df7623
|
||||
F sqlite3.1 6be1ad09113570e1fc8dcaff84c9b0b337db5ffc
|
||||
F sqlite3.def a1be7b9a4b8b51ac41c6ff6e8e44a14ef66b338b
|
||||
F sqlite3.pc.in 32b8a014799c2028c8e0c9cc5659718262fc493f
|
||||
F src/alter.c 2c541aaa88d720301253f181799d4af7bb9ddf1c
|
||||
F src/alter.c f1c7a868b72dda8ce72c1292479c6e8979924a74
|
||||
F src/analyze.c 747ce8cb6b318bb0d0576cfb5277aed98cbbeb5c
|
||||
F src/attach.c a85c14612e7e3410e0c3d2e0241832fa9688bd14
|
||||
F src/attach.c c4adb24b40039bf6fcb091db7db51524e44c5505
|
||||
F src/auth.c c8b2ab5c8bad4bd90ed7c294694f48269162c627
|
||||
F src/bitvec.c 95c86bd18d8fedf0533f5af196192546e10a7e7d
|
||||
F src/btmutex.c 709cad2cdca0afd013f0f612363810e53f59ec53
|
||||
F src/btree.c da7491ef06c0209da962e1520bfc5c90b5c5cc96
|
||||
F src/btree.c 171eceee4a8d8eac8fbd35858ed116489f695638
|
||||
F src/btree.h 03256ed7ee42b5ecacbe887070b0f8249e7d069d
|
||||
F src/btreeInt.h ab18c7b4980314e9e4b402e5dcde09f3c2545576
|
||||
F src/build.c f774f01e10885319d8f839cf00f25cc6a8a7d605
|
||||
F src/build.c d8fe03f76229e333c9e1989eb22b4120f1f46376
|
||||
F src/callback.c c9f75a4c403f166af3761df47d78a806587d63af
|
||||
F src/complete.c cb14e06dbe79dee031031f0d9e686ff306afe07c
|
||||
F src/date.c 52a54811218a76da6235420f532ece841159a96d
|
||||
F src/delete.c 0d115c173863b3c688c3083ef7857c7f2e9f7a18
|
||||
F src/expr.c 4f5221197384d923525fdfd117298eab073e9539
|
||||
F src/delete.c 28595a17b73d40e35fd285cd3741e9f5bade6b1d
|
||||
F src/expr.c d2046feae56970f15dd6fc89fb9193d973fbb644
|
||||
F src/fault.c 3638519d1e0b82bccfafcb9f5ff491918b28f8e1
|
||||
F src/func.c 54efe220cc1ef3859a4b738011621b63a0d697c5
|
||||
F src/func.c 596688b58c289e922e40139d030f847d1f82bf34
|
||||
F src/global.c b9c96ee2317a6e1391763c7db1098a6473a91863
|
||||
F src/hash.c eb64e48f3781100e5934f759fbe72a63a8fe78cb
|
||||
F src/hash.h 031cd9f915aff27e12262cb9eb570ac1b8326b53
|
||||
F src/hwtime.h 4a1d45f4cae1f402ea19686acf24acf4f0cb53cb
|
||||
F src/insert.c 89cd9af52a5ea6fb7d0cfc9c3b935d6406c360c4
|
||||
F src/insert.c 223a368a9e0d1e446a8df091a5b65189df4c5704
|
||||
F src/journal.c cffd2cd214e58c0e99c3ff632b3bee6c7cbb260e
|
||||
F src/legacy.c aac57bd984e666059011ea01ec4383892a253be3
|
||||
F src/loadext.c eb1fe4f44d7c8ff53fc0c6a4388ab79fbd34cd64
|
||||
F src/main.c d750c6c0d381252851401f6ea2ee72185de005ed
|
||||
F src/main.c bafdff2621497d602a5010a8700297d5fd8a9792
|
||||
F src/malloc.c 22c68fc62f0c2df0f1deb8cd9a5ea968f995cac2
|
||||
F src/md5.c 008216bbb5d34c6fbab5357aa68575ad8a31516a
|
||||
F src/mem1.c 3a7fe31d8290baa3bb203af72f7dfd6323966bcd
|
||||
@@ -133,18 +136,18 @@ F src/os.c 939ae7690a01d9401685ba124b4ba45fd4a7a2ad
|
||||
F src/os.h ef8abeb9afc694b82dbd169a91c9b7e26db3c892
|
||||
F src/os_common.h 24525d8b7bce66c374dfc1810a6c9043f3359b60
|
||||
F src/os_os2.c 676ed273b17bd260f905df81375c9f9950d85517
|
||||
F src/os_unix.c fe0dbc35bcd3de49e46b132abfc0f45d6dd6a864
|
||||
F src/os_unix.c 23b64faec0762bdc878c8ea61ab38d4ae9575318
|
||||
F src/os_win.c aefe9ee26430678a19a058a874e4e2bd91398142
|
||||
F src/pager.c b6a366f2343e7f127d7e70dbe76cd664336143cd
|
||||
F src/pager.c c78c9558060ca045eb973f9b87da70a0ac28992a
|
||||
F src/pager.h 588c1ac195228b2da45c4e5f7ab6c2fd253d1751
|
||||
F src/parse.y d962e544d9953289db23c1d4cc2dab514c7136fa
|
||||
F src/pragma.c 6e207b4f69901089758c02c02e0bf86ed12a4d8f
|
||||
F src/prepare.c d9f420808f7d2802258f0bf64103271311e2d87f
|
||||
F src/printf.c 2e984b2507291a7e16d89dc9bb60582904f6247d
|
||||
F src/printf.c fd40f2fe2951b34290ad1c2d8b65a375b7ea2194
|
||||
F src/random.c 5c754319d38abdd6acd74601ee0105504adc508a
|
||||
F src/select.c c1899b14f5eb3d3b71aeb02d541d6c5052ad3b70
|
||||
F src/select.c c5d15b97a5a26b34f83b0109e4bca398b703164b
|
||||
F src/shell.c 4b835fe734304ac22a3385868cd3790c1e4f7aa1
|
||||
F src/sqlite.h.in 157cd9932c2747a6ef3cb091e006185f4f9105d3
|
||||
F src/sqlite.h.in b6f0bb400e82d271709412ab59ee898d6a4c196a
|
||||
F src/sqlite3ext.h 1e3887c9bd3ae66cb599e922824b04cd0d0f2c3e
|
||||
F src/sqliteInt.h 685b9cf6537e59e4453269b43acb33c59b566346
|
||||
F src/sqliteLimit.h f435e728c6b620ef7312814d660a81f9356eb5c8
|
||||
@@ -179,11 +182,11 @@ F src/test_tclvar.c 73530070df8378571c8ce6bbbbb993236ae3ad0b
|
||||
F src/test_thread.c e297dd41db0b249646e69f97d36ec13e56e8b730
|
||||
F src/tokenize.c bfdc945527a4645bf54c8bf34d1f18c019b37117
|
||||
F src/trigger.c b61aaf7bff8e3763b234dbf46a1a64fb88a34e64
|
||||
F src/update.c 79b77a3cc8ed5f8903a7f37055fcedd69388dcae
|
||||
F src/update.c 1d7d70ac77b4e2fd9004f1279ed5dc645599ece9
|
||||
F src/utf.c a7004436a6ef2aee012ace93de274dd0f3c7624e
|
||||
F src/util.c afe659ccc05d1f8af9e8631dabfec3ee3a7144af
|
||||
F src/util.c 2f10789f4b25f36822d663773f56ce9d33c7ea11
|
||||
F src/vacuum.c ef342828002debc97514617af3424aea8ef8522c
|
||||
F src/vdbe.c 96e0527ad121b1308ed4ab5d02ff5b8a5f434e7f
|
||||
F src/vdbe.c 412c486b22f29cfdf922c6588c209f35127c3962
|
||||
F src/vdbe.h 647fcf33a551ba10a974162c56846cb9aef2276b
|
||||
F src/vdbeInt.h 6f04c2bf65a0d5c2bb8318b226278a35d1f7a8f5
|
||||
F src/vdbeapi.c 803f365b77a22c1b2680a0dee9202bc75c02bf4a
|
||||
@@ -207,7 +210,7 @@ F test/async3.test 9ffa0977a78cc6351862a1583be2b1eecd41736d
|
||||
F test/attach.test 75a5d22f88e730967d68f2c9f95e786e3953d8e3
|
||||
F test/attach2.test a295d2d7061adcee5884ef4a93c7c96a82765437
|
||||
F test/attach3.test 7b92dc8e40c1ebca9732ca6f2d3fefbd46f196df
|
||||
F test/attachmalloc.test ccbde53bcb0a61020afa3e0670ca9c6c5b99af32
|
||||
F test/attachmalloc.test 95826e77cad2507b2b260b8fa6e4ec624e20c345
|
||||
F test/auth.test 9eb4b6b99eee54c95711c74c4b9694acf4d850ed
|
||||
F test/auth2.test ee3ba272e2b975e913afc9b041ee75706e190005
|
||||
F test/autoinc.test 42af2c407c4e37d0626f9cda57ed381e94522c9d
|
||||
@@ -283,7 +286,7 @@ F test/exclusive2.test d13bf66753dca46e61241d35d36ab7c868b0d313
|
||||
F test/exec.test e949714dc127eaa5ecc7d723efec1ec27118fdd7
|
||||
F test/expr.test a47d304a90c75def083cce3b1cd6c282842e6bbe
|
||||
F test/filectrl.test 524853082d5d7fb442599730ec3a0f3f84a3a936
|
||||
F test/filefmt.test 053b622009fbbb74dd37921ffad374d852c13cd8
|
||||
F test/filefmt.test f0e14d428fe33c5199de59a7b640041bd4fc6082
|
||||
F test/fkey1.test dcb4f28eb22d5141f15161d6bdca9a4f58c95729
|
||||
F test/format4.test 1f0cac8ff3895e9359ed87e41aaabee982a812eb
|
||||
F test/fts1a.test 46090311f85da51bb33bd5ce84f7948359c6d8d7
|
||||
@@ -368,7 +371,7 @@ F test/insert4.test 6e382eaf7295a4463e6f29ea20fcd8e63d097eeb
|
||||
F test/insert5.test 1f93cbe9742110119133d7e8e3ccfe6d7c249766
|
||||
F test/interrupt.test 42e7cf98646fd9cb4a3b131a93ed3c50b9e149f1
|
||||
F test/intpkey.test 537669fd535f62632ca64828e435b9e54e8d677f
|
||||
F test/io.test 23c52939ebf90f00d9cbd819ced6daa9f21445fa
|
||||
F test/io.test b9d9d627db72ded2227e23bf03b45067047f9d8b
|
||||
F test/ioerr.test b42f249c9181b5864e53fdae38ef75475d71c66f
|
||||
F test/ioerr2.test 5598405c48842c6c0187daad9eb49eff2c54f80d
|
||||
F test/ioerr3.test d3cec5e1a11ad6d27527d0d38573fbff14c71bdd
|
||||
@@ -568,7 +571,7 @@ F test/utf16align.test 7360e84472095518c56746f76b1f9d4dce99fb4d
|
||||
F test/vacuum.test 0bc75ee74ab9c69322d6563aa2287375697e630b
|
||||
F test/vacuum2.test d3b9691541fe6ed5c711f547a1c7d70e9760ac6f
|
||||
F test/vacuum3.test 306b65554980d8d4a3b6eeb7b3ccd11c65ebb540
|
||||
F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102
|
||||
F test/varint.test bbce22cda8fc4d135bcc2b589574be8410614e62
|
||||
F test/veryquick.test e265401afefa994cdf2fe4b6f286b1e87c2f9b9d
|
||||
F test/view.test 5799906511d6c77cfe3516d3d1189224350ef732
|
||||
F test/vtab1.test e321e3c80434fe8de97fa4ad815882d2c7838d21
|
||||
@@ -617,7 +620,14 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
|
||||
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
||||
F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1
|
||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||
P 01fb8a0d2ca1d7ac31316cef1675dc9852265db6
|
||||
R f1679cb1675cee37fa12d4fa26f13c35
|
||||
P a1d20ceb9c195ea96f09c2a40c898ca75f504ee1
|
||||
R c259aebb9828e6f7d53c890c0f40fdc0
|
||||
U drh
|
||||
Z 56e89e221c5215782fe30888ef49647e
|
||||
Z 4822e36c81dd65a9c9827d7899fd3725
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v1.4.6 (GNU/Linux)
|
||||
|
||||
iD8DBQFL8on0oxKgR168RlERAth0AJ9D0mKQbfnHqPlltZbvAMr/uU7AwgCfdTA5
|
||||
llbwG9OuQTdAiZSIr/wVN/w=
|
||||
=xMw6
|
||||
-----END PGP SIGNATURE-----
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
65ab777fd0a29ca99a240411b94ac83041f90c98
|
||||
97d88a86e45e7a4269efd2fafdd4e6081d1475f8
|
||||
+2
-2
@@ -46,7 +46,7 @@ static void renameTableFunc(
|
||||
unsigned char const *zTableName = sqlite3_value_text(argv[1]);
|
||||
|
||||
int token;
|
||||
Token tname;
|
||||
Token tname = {0,0,0}; /* Initialized to placate warning */
|
||||
unsigned char const *zCsr = zSql;
|
||||
int len = 0;
|
||||
char *zRet;
|
||||
@@ -101,7 +101,7 @@ static void renameTriggerFunc(
|
||||
unsigned char const *zTableName = sqlite3_value_text(argv[1]);
|
||||
|
||||
int token;
|
||||
Token tname;
|
||||
Token tname = {0,0,0}; /* Initialized to placate warning */
|
||||
int dist = 3;
|
||||
unsigned char const *zCsr = zSql;
|
||||
int len = 0;
|
||||
|
||||
+4
-1
@@ -144,8 +144,11 @@ static void attachFunc(
|
||||
sqlite3PagerLockingMode(pPager, db->dfltLockMode);
|
||||
sqlite3PagerJournalMode(pPager, db->dfltJournalMode);
|
||||
}
|
||||
aNew->zName = sqlite3DbStrDup(db, zName);
|
||||
aNew->safety_level = 3;
|
||||
aNew->zName = sqlite3DbStrDup(db, zName);
|
||||
if( rc==SQLITE_OK && aNew->zName==0 ){
|
||||
rc = SQLITE_NOMEM;
|
||||
}
|
||||
|
||||
#if SQLITE_HAS_CODEC
|
||||
{
|
||||
|
||||
+1
-1
@@ -3021,7 +3021,7 @@ static int getOverflowPage(
|
||||
Pgno *pPgnoNext /* OUT: Next overflow page number */
|
||||
){
|
||||
Pgno next = 0;
|
||||
int rc;
|
||||
int rc = SQLITE_OK; /* Initialized to placate warning */
|
||||
|
||||
assert( sqlite3_mutex_held(pBt->mutex) );
|
||||
/* One of these must not be NULL. Otherwise, why call this function? */
|
||||
|
||||
+2
-1
@@ -2754,7 +2754,8 @@ void sqlite3CreateIndex(
|
||||
/* Clean up before exiting */
|
||||
exit_create_index:
|
||||
if( pIndex ){
|
||||
freeIndex(pIndex);
|
||||
sqlite3_free(pIndex->zColAff);
|
||||
sqlite3DbFree(db, pIndex);
|
||||
}
|
||||
sqlite3ExprListDelete(db, pList);
|
||||
sqlite3SrcListDelete(db, pTblName);
|
||||
|
||||
+4
-4
@@ -143,10 +143,10 @@ void sqlite3DeleteFrom(
|
||||
int isView; /* True if attempting to delete from a view */
|
||||
int triggers_exist = 0; /* True if any triggers exist */
|
||||
#endif
|
||||
int iBeginAfterTrigger; /* Address of after trigger program */
|
||||
int iEndAfterTrigger; /* Exit of after trigger program */
|
||||
int iBeginBeforeTrigger; /* Address of before trigger program */
|
||||
int iEndBeforeTrigger; /* Exit of before trigger program */
|
||||
int iBeginAfterTrigger = 0; /* Address of after trigger program */
|
||||
int iEndAfterTrigger = 0; /* Exit of after trigger program */
|
||||
int iBeginBeforeTrigger = 0; /* Address of before trigger program */
|
||||
int iEndBeforeTrigger = 0; /* Exit of before trigger program */
|
||||
u32 old_col_mask = 0; /* Mask of OLD.* columns in use */
|
||||
|
||||
sContext.pParse = 0;
|
||||
|
||||
+1
-1
@@ -2737,7 +2737,7 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){
|
||||
Expr opCompare; /* The X==Ei expression */
|
||||
Expr cacheX; /* Cached expression X */
|
||||
Expr *pX; /* The X expression */
|
||||
Expr *pTest; /* X==Ei (form A) or just Ei (form B) */
|
||||
Expr *pTest = 0; /* X==Ei (form A) or just Ei (form B) */
|
||||
|
||||
assert(pExpr->pList);
|
||||
assert((pExpr->pList->nExpr % 2) == 0);
|
||||
|
||||
+2
-2
@@ -911,7 +911,7 @@ static void trimFunc(
|
||||
flags = SQLITE_PTR_TO_INT(sqlite3_user_data(context));
|
||||
if( flags & 1 ){
|
||||
while( nIn>0 ){
|
||||
int len;
|
||||
int len = 0; /* Initialized to placate warning. */
|
||||
for(i=0; i<nChar; i++){
|
||||
len = aLen[i];
|
||||
if( memcmp(zIn, azChar[i], len)==0 ) break;
|
||||
@@ -923,7 +923,7 @@ static void trimFunc(
|
||||
}
|
||||
if( flags & 2 ){
|
||||
while( nIn>0 ){
|
||||
int len;
|
||||
int len = 0; /* Initialized to placate warning. */
|
||||
for(i=0; i<nChar; i++){
|
||||
len = aLen[i];
|
||||
if( len<=nIn && memcmp(&zIn[nIn-len],azChar[i],len)==0 ) break;
|
||||
|
||||
+4
-3
@@ -388,14 +388,14 @@ void sqlite3Insert(
|
||||
int appendFlag = 0; /* True if the insert is likely to be an append */
|
||||
|
||||
/* Register allocations */
|
||||
int regFromSelect; /* Base register for data coming from SELECT */
|
||||
int regFromSelect = 0;/* Base register for data coming from SELECT */
|
||||
int regAutoinc = 0; /* Register holding the AUTOINCREMENT counter */
|
||||
int regRowCount = 0; /* Memory cell used for the row counter */
|
||||
int regIns; /* Block of regs holding rowid+data being inserted */
|
||||
int regRowid; /* registers holding insert rowid */
|
||||
int regData; /* register holding first column to insert */
|
||||
int regRecord; /* Holds the assemblied row record */
|
||||
int regEof; /* Register recording end of SELECT data */
|
||||
int regEof = 0; /* Register recording end of SELECT data */
|
||||
int *aRegIdx = 0; /* One register allocated to each index */
|
||||
|
||||
|
||||
@@ -1095,7 +1095,8 @@ void sqlite3GenerateConstraintChecks(
|
||||
Vdbe *v;
|
||||
int nCol;
|
||||
int onError;
|
||||
int j1, j2, j3; /* Addresses of jump instructions */
|
||||
int j1, j3; /* Addresses of jump instructions */
|
||||
int j2 = 0; /* Initialized to placate warning */
|
||||
int regData; /* Register containing first data column */
|
||||
int iCur;
|
||||
Index *pIdx;
|
||||
|
||||
+11
-18
@@ -1131,31 +1131,24 @@ const char *sqlite3_errmsg(sqlite3 *db){
|
||||
** error.
|
||||
*/
|
||||
const void *sqlite3_errmsg16(sqlite3 *db){
|
||||
/* Because all the characters in the string are in the unicode
|
||||
** range 0x00-0xFF, if we pad the big-endian string with a
|
||||
** zero byte, we can obtain the little-endian string with
|
||||
** &big_endian[1].
|
||||
*/
|
||||
static const char outOfMemBe[] = {
|
||||
0, 'o', 0, 'u', 0, 't', 0, ' ',
|
||||
0, 'o', 0, 'f', 0, ' ',
|
||||
0, 'm', 0, 'e', 0, 'm', 0, 'o', 0, 'r', 0, 'y', 0, 0, 0
|
||||
static const u16 outOfMem[] = {
|
||||
'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
|
||||
};
|
||||
static const char misuseBe [] = {
|
||||
0, 'l', 0, 'i', 0, 'b', 0, 'r', 0, 'a', 0, 'r', 0, 'y', 0, ' ',
|
||||
0, 'r', 0, 'o', 0, 'u', 0, 't', 0, 'i', 0, 'n', 0, 'e', 0, ' ',
|
||||
0, 'c', 0, 'a', 0, 'l', 0, 'l', 0, 'e', 0, 'd', 0, ' ',
|
||||
0, 'o', 0, 'u', 0, 't', 0, ' ',
|
||||
0, 'o', 0, 'f', 0, ' ',
|
||||
0, 's', 0, 'e', 0, 'q', 0, 'u', 0, 'e', 0, 'n', 0, 'c', 0, 'e', 0, 0, 0
|
||||
static const u16 misuse[] = {
|
||||
'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ',
|
||||
'r', 'o', 'u', 't', 'i', 'n', 'e', ' ',
|
||||
'c', 'a', 'l', 'l', 'e', 'd', ' ',
|
||||
'o', 'u', 't', ' ',
|
||||
'o', 'f', ' ',
|
||||
's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', 0
|
||||
};
|
||||
|
||||
const void *z;
|
||||
if( !db ){
|
||||
return (void *)(&outOfMemBe[SQLITE_UTF16NATIVE==SQLITE_UTF16LE?1:0]);
|
||||
return (void *)outOfMem;
|
||||
}
|
||||
if( !sqlite3SafetyCheckSickOrOk(db) ){
|
||||
return (void *)(&misuseBe[SQLITE_UTF16NATIVE==SQLITE_UTF16LE?1:0]);
|
||||
return (void *)misuse;
|
||||
}
|
||||
sqlite3_mutex_enter(db->mutex);
|
||||
assert( !db->mallocFailed );
|
||||
|
||||
@@ -2055,6 +2055,12 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){
|
||||
*(int*)pArg = ((unixFile*)id)->locktype;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
case SQLITE_FCNTL_SIZE_HINT: {
|
||||
sqlite3_int64 szFile = *(sqlite3_int64*)pArg;
|
||||
unixFile *pFile = (unixFile*)id;
|
||||
ftruncate(pFile->h, szFile);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
}
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
|
||||
+33
-13
@@ -358,6 +358,7 @@ struct Pager {
|
||||
int errCode; /* One of several kinds of errors */
|
||||
int dbSize; /* Number of pages in the file */
|
||||
int origDbSize; /* dbSize before the current change */
|
||||
int hintDbSize; /* dbSize sent to SQLITE_FCNTL_SIZE_HINT */
|
||||
int stmtSize; /* Size of database (in pages) at stmt_begin() */
|
||||
int nRec; /* Number of pages written to the journal */
|
||||
u32 cksumInit; /* Quasi-random value added to every checksum */
|
||||
@@ -1358,6 +1359,7 @@ static void pager_unlock(Pager *pPager){
|
||||
pPager->journalStarted = 0;
|
||||
pPager->stmtAutoopen = 0;
|
||||
pPager->origDbSize = 0;
|
||||
pPager->hintDbSize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1457,6 +1459,7 @@ static int pager_end_transaction(Pager *pPager, int hasMaster){
|
||||
pPager->state = PAGER_EXCLUSIVE;
|
||||
}
|
||||
pPager->origDbSize = 0;
|
||||
pPager->hintDbSize = 0;
|
||||
pPager->setMaster = 0;
|
||||
pPager->needSync = 0;
|
||||
lruListSetFirstSynced(pPager);
|
||||
@@ -3032,6 +3035,8 @@ static int pager_write_pagelist(PgHdr *pList){
|
||||
Pager *pPager;
|
||||
PgHdr *p;
|
||||
int rc;
|
||||
Pgno mxPgno; /* Maximum page number to be written */
|
||||
int nExtend = 0; /* Number of pages on pList that extend the file */
|
||||
|
||||
if( pList==0 ) return SQLITE_OK;
|
||||
pPager = pList->pPager;
|
||||
@@ -3061,16 +3066,30 @@ static int pager_write_pagelist(PgHdr *pList){
|
||||
for(p=pList; p; p=p->pDirty){
|
||||
assert( p->dirty );
|
||||
p->dirty = 0;
|
||||
mxPgno = p->pgno;
|
||||
if( p->pgno>pPager->hintDbSize ) nExtend++;
|
||||
}
|
||||
|
||||
/* If the file has not yet been opened, open it now. */
|
||||
if( !pPager->fd->pMethods ){
|
||||
assert(pPager->tempFile);
|
||||
rc = sqlite3PagerOpentemp(pPager, pPager->fd, pPager->vfsFlags);
|
||||
if( rc ) return rc;
|
||||
}
|
||||
|
||||
/* Before the first write, give the VFS a hint of what the final
|
||||
** file size will be.
|
||||
*/
|
||||
if( nExtend>1 || (nExtend==1 && pPager->dbSize>mxPgno) ){
|
||||
sqlite3_int64 szFile;
|
||||
assert( pPager->hintDbSize<mxPgno );
|
||||
assert( mxPgno<=pPager->dbSize );
|
||||
szFile = pPager->pageSize * (sqlite3_int64)pPager->dbSize;
|
||||
sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_SIZE_HINT, &szFile);
|
||||
pPager->hintDbSize = pPager->dbSize;
|
||||
}
|
||||
|
||||
while( pList ){
|
||||
|
||||
/* If the file has not yet been opened, open it now. */
|
||||
if( !pPager->fd->pMethods ){
|
||||
assert(pPager->tempFile);
|
||||
rc = sqlite3PagerOpentemp(pPager, pPager->fd, pPager->vfsFlags);
|
||||
if( rc ) return rc;
|
||||
}
|
||||
|
||||
/* If there are dirty pages in the page cache with page numbers greater
|
||||
** than Pager.dbSize, this means sqlite3PagerTruncate() was called to
|
||||
** make the file smaller (presumably by auto-vacuum code). Do not write
|
||||
@@ -3655,7 +3674,7 @@ static int pagerAllocatePage(Pager *pPager, PgHdr **ppPg){
|
||||
|| MEMDB
|
||||
|| (pPager->lru.pFirstSynced==0 && pPager->doNotSync)
|
||||
){
|
||||
void *pData;
|
||||
void *pData = 0; /* Initialized to placate warning */
|
||||
if( pPager->nPage>=pPager->nHash ){
|
||||
pager_resize_hash_table(pPager,
|
||||
pPager->nHash<256 ? 256 : pPager->nHash*2);
|
||||
@@ -4017,7 +4036,7 @@ static int pager_open_journal(Pager *pPager){
|
||||
rc = pPager->errCode;
|
||||
goto failed_to_open_journal;
|
||||
}
|
||||
pPager->origDbSize = pPager->dbSize;
|
||||
pPager->hintDbSize = pPager->origDbSize = pPager->dbSize;
|
||||
|
||||
rc = writeJournalHdr(pPager);
|
||||
|
||||
@@ -4075,7 +4094,7 @@ int sqlite3PagerBegin(DbPage *pPg, int exFlag){
|
||||
assert( pPager->pInJournal==0 );
|
||||
if( MEMDB ){
|
||||
pPager->state = PAGER_EXCLUSIVE;
|
||||
pPager->origDbSize = pPager->dbSize;
|
||||
pPager->hintDbSize = pPager->origDbSize = pPager->dbSize;
|
||||
}else{
|
||||
rc = sqlite3OsLock(pPager->fd, RESERVED_LOCK);
|
||||
if( rc==SQLITE_OK ){
|
||||
@@ -4104,6 +4123,7 @@ int sqlite3PagerBegin(DbPage *pPg, int exFlag){
|
||||
*/
|
||||
assert( pPager->nRec==0 );
|
||||
assert( pPager->origDbSize==0 );
|
||||
assert( pPager->hintDbSize==0 );
|
||||
assert( pPager->pInJournal==0 );
|
||||
sqlite3PagerPagecount(pPager, 0);
|
||||
pagerLeave(pPager);
|
||||
@@ -4112,7 +4132,7 @@ int sqlite3PagerBegin(DbPage *pPg, int exFlag){
|
||||
if( !pPager->pInJournal ){
|
||||
rc = SQLITE_NOMEM;
|
||||
}else{
|
||||
pPager->origDbSize = pPager->dbSize;
|
||||
pPager->hintDbSize = pPager->origDbSize = pPager->dbSize;
|
||||
rc = writeJournalHdr(pPager);
|
||||
}
|
||||
}
|
||||
@@ -4907,7 +4927,7 @@ int sqlite3PagerRollback(Pager *pPager){
|
||||
}
|
||||
pPager->pDirty = 0;
|
||||
pPager->pStmt = 0;
|
||||
pPager->dbSize = pPager->origDbSize;
|
||||
pPager->dbSize = pPager->hintDbSize = pPager->origDbSize;
|
||||
pager_truncate_cache(pPager);
|
||||
pPager->stmtInUse = 0;
|
||||
pPager->state = PAGER_SHARED;
|
||||
|
||||
+1
-1
@@ -247,7 +247,7 @@ void sqlite3VXPrintf(
|
||||
char buf[etBUFSIZE]; /* Conversion buffer */
|
||||
char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */
|
||||
etByte errorflag = 0; /* True if an error is encountered */
|
||||
etByte xtype; /* Conversion paradigm */
|
||||
etByte xtype = 0; /* Conversion paradigm */
|
||||
char *zExtra; /* Extra memory used for etTCLESCAPE conversions */
|
||||
#ifndef SQLITE_OMIT_FLOATING_POINT
|
||||
int exp, e2; /* exponent of real numbers */
|
||||
|
||||
+2
-2
@@ -2467,7 +2467,7 @@ static int multiSelectOrderBy(
|
||||
int regOutA; /* Address register for the output-A subroutine */
|
||||
int regOutB; /* Address register for the output-B subroutine */
|
||||
int addrOutA; /* Address of the output-A subroutine */
|
||||
int addrOutB; /* Address of the output-B subroutine */
|
||||
int addrOutB = 0; /* Address of the output-B subroutine */
|
||||
int addrEofA; /* Address of the select-A-exhausted subroutine */
|
||||
int addrEofB; /* Address of the select-B-exhausted subroutine */
|
||||
int addrAltB; /* Address of the A<B subroutine */
|
||||
@@ -2482,7 +2482,7 @@ static int multiSelectOrderBy(
|
||||
int labelEnd; /* Label for the end of the overall SELECT stmt */
|
||||
int j1; /* Jump instructions that get retargetted */
|
||||
int op; /* One of TK_ALL, TK_UNION, TK_EXCEPT, TK_INTERSECT */
|
||||
KeyInfo *pKeyDup; /* Comparison information for duplicate removal */
|
||||
KeyInfo *pKeyDup = 0; /* Comparison information for duplicate removal */
|
||||
KeyInfo *pKeyMerge; /* Comparison information for merging rows */
|
||||
sqlite3 *db; /* Database connection */
|
||||
ExprList *pOrderBy; /* The ORDER BY clause */
|
||||
|
||||
@@ -698,8 +698,16 @@ struct sqlite3_io_methods {
|
||||
** into an integer that the pArg argument points to. This capability
|
||||
** is used during testing and only needs to be supported when SQLITE_TEST
|
||||
** is defined.
|
||||
**
|
||||
** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS
|
||||
** layer a hint of how large the database file will grow to be during the
|
||||
** current transaction. This hint is not guaranteed to be accurate but it
|
||||
** is often close. The underlying VFS might choose to preallocate database
|
||||
** file space based on this hint in order to help writes to the database
|
||||
** file run faster.
|
||||
*/
|
||||
#define SQLITE_FCNTL_LOCKSTATE 1
|
||||
#define SQLITE_FCNTL_SIZE_HINT 2
|
||||
|
||||
/*
|
||||
** CAPI3REF: Mutex Handle {H17110} <S20130>
|
||||
|
||||
+4
-4
@@ -109,10 +109,10 @@ void sqlite3Update(
|
||||
int isView; /* Trying to update a view */
|
||||
int triggers_exist = 0; /* True if any row triggers exist */
|
||||
#endif
|
||||
int iBeginAfterTrigger; /* Address of after trigger program */
|
||||
int iEndAfterTrigger; /* Exit of after trigger program */
|
||||
int iBeginBeforeTrigger; /* Address of before trigger program */
|
||||
int iEndBeforeTrigger; /* Exit of before trigger program */
|
||||
int iBeginAfterTrigger = 0; /* Address of after trigger program */
|
||||
int iEndAfterTrigger = 0; /* Exit of after trigger program */
|
||||
int iBeginBeforeTrigger = 0; /* Address of before trigger program */
|
||||
int iEndBeforeTrigger = 0; /* Exit of before trigger program */
|
||||
u32 old_col_mask = 0; /* Mask of OLD.* columns in use */
|
||||
u32 new_col_mask = 0; /* Mask of NEW.* columns in use */
|
||||
|
||||
|
||||
+29
-12
@@ -545,6 +545,19 @@ int sqlite3PutVarint32(unsigned char *p, u32 v){
|
||||
return sqlite3PutVarint(p, v);
|
||||
}
|
||||
|
||||
/*
|
||||
** Bitmasks used by sqlite3GetVarint(). These precomputed constants
|
||||
** are defined here rather than simply putting the constant expressions
|
||||
** inline in order to work around bugs in the RVT compiler.
|
||||
**
|
||||
** SLOT_2_0 A mask for (0x7f<<14) | 0x7f
|
||||
**
|
||||
** SLOT_4_2_0 A mask for (0x7f<<28) | SLOT_2_0
|
||||
*/
|
||||
#define SLOT_2_0 0x001fc07f
|
||||
#define SLOT_4_2_0 0xf01fc07f
|
||||
|
||||
|
||||
/*
|
||||
** Read a 64-bit variable-length integer from memory starting at p[0].
|
||||
** Return the number of bytes read. The value is stored in *v.
|
||||
@@ -572,13 +585,17 @@ int sqlite3GetVarint(const unsigned char *p, u64 *v){
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* Verify that constants are precomputed correctly */
|
||||
assert( SLOT_2_0 == ((0x7f<<14) | (0x7f)) );
|
||||
assert( SLOT_4_2_0 == ((0xf<<28) | (0x7f<<14) | (0x7f)) );
|
||||
|
||||
p++;
|
||||
a = a<<14;
|
||||
a |= *p;
|
||||
/* a: p0<<14 | p2 (unmasked) */
|
||||
if (!(a&0x80))
|
||||
{
|
||||
a &= (0x7f<<14)|(0x7f);
|
||||
a &= SLOT_2_0;
|
||||
b &= 0x7f;
|
||||
b = b<<7;
|
||||
a |= b;
|
||||
@@ -587,14 +604,14 @@ int sqlite3GetVarint(const unsigned char *p, u64 *v){
|
||||
}
|
||||
|
||||
/* CSE1 from below */
|
||||
a &= (0x7f<<14)|(0x7f);
|
||||
a &= SLOT_2_0;
|
||||
p++;
|
||||
b = b<<14;
|
||||
b |= *p;
|
||||
/* b: p1<<14 | p3 (unmasked) */
|
||||
if (!(b&0x80))
|
||||
{
|
||||
b &= (0x7f<<14)|(0x7f);
|
||||
b &= SLOT_2_0;
|
||||
/* moved CSE1 up */
|
||||
/* a &= (0x7f<<14)|(0x7f); */
|
||||
a = a<<7;
|
||||
@@ -608,7 +625,7 @@ int sqlite3GetVarint(const unsigned char *p, u64 *v){
|
||||
/* 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked) */
|
||||
/* moved CSE1 up */
|
||||
/* a &= (0x7f<<14)|(0x7f); */
|
||||
b &= (0x7f<<14)|(0x7f);
|
||||
b &= SLOT_2_0;
|
||||
s = a;
|
||||
/* s: p0<<14 | p2 (masked) */
|
||||
|
||||
@@ -641,7 +658,7 @@ int sqlite3GetVarint(const unsigned char *p, u64 *v){
|
||||
{
|
||||
/* we can skip this cause it was (effectively) done above in calc'ing s */
|
||||
/* b &= (0x7f<<28)|(0x7f<<14)|(0x7f); */
|
||||
a &= (0x7f<<14)|(0x7f);
|
||||
a &= SLOT_2_0;
|
||||
a = a<<7;
|
||||
a |= b;
|
||||
s = s>>18;
|
||||
@@ -655,8 +672,8 @@ int sqlite3GetVarint(const unsigned char *p, u64 *v){
|
||||
/* a: p2<<28 | p4<<14 | p6 (unmasked) */
|
||||
if (!(a&0x80))
|
||||
{
|
||||
a &= (0x7f<<28)|(0x7f<<14)|(0x7f);
|
||||
b &= (0x7f<<14)|(0x7f);
|
||||
a &= SLOT_4_2_0;
|
||||
b &= SLOT_2_0;
|
||||
b = b<<7;
|
||||
a |= b;
|
||||
s = s>>11;
|
||||
@@ -665,14 +682,14 @@ int sqlite3GetVarint(const unsigned char *p, u64 *v){
|
||||
}
|
||||
|
||||
/* CSE2 from below */
|
||||
a &= (0x7f<<14)|(0x7f);
|
||||
a &= SLOT_2_0;
|
||||
p++;
|
||||
b = b<<14;
|
||||
b |= *p;
|
||||
/* b: p3<<28 | p5<<14 | p7 (unmasked) */
|
||||
if (!(b&0x80))
|
||||
{
|
||||
b &= (0x7f<<28)|(0x7f<<14)|(0x7f);
|
||||
b &= SLOT_4_2_0;
|
||||
/* moved CSE2 up */
|
||||
/* a &= (0x7f<<14)|(0x7f); */
|
||||
a = a<<7;
|
||||
@@ -689,7 +706,7 @@ int sqlite3GetVarint(const unsigned char *p, u64 *v){
|
||||
|
||||
/* moved CSE2 up */
|
||||
/* a &= (0x7f<<29)|(0x7f<<15)|(0xff); */
|
||||
b &= (0x7f<<14)|(0x7f);
|
||||
b &= SLOT_2_0;
|
||||
b = b<<8;
|
||||
a |= b;
|
||||
|
||||
@@ -767,8 +784,8 @@ int sqlite3GetVarint32(const unsigned char *p, u32 *v){
|
||||
/* a: p0<<28 | p2<<14 | p4 (unmasked) */
|
||||
if (!(a&0x80))
|
||||
{
|
||||
a &= (0x7f<<28)|(0x7f<<14)|(0x7f);
|
||||
b &= (0x7f<<28)|(0x7f<<14)|(0x7f);
|
||||
a &= SLOT_4_2_0;
|
||||
b &= SLOT_4_2_0;
|
||||
b = b<<7;
|
||||
*v = a | b;
|
||||
return 5;
|
||||
|
||||
+5
-3
@@ -543,8 +543,10 @@ int sqlite3VdbeExec(
|
||||
int rc = SQLITE_OK; /* Value to return */
|
||||
sqlite3 *db = p->db; /* The database */
|
||||
u8 encoding = ENC(db); /* The database encoding */
|
||||
Mem *pIn1, *pIn2, *pIn3; /* Input operands */
|
||||
Mem *pOut; /* Output operand */
|
||||
Mem *pIn1 = 0; /* Input operands */
|
||||
Mem *pIn2 = 0; /* Input operands */
|
||||
Mem *pIn3 = 0; /* Input operands */
|
||||
Mem *pOut = 0; /* Output operand */
|
||||
u8 opProperty;
|
||||
int iCompare = 0; /* Result of last OP_Compare operation */
|
||||
int *aPermute = 0; /* Permuation of columns for OP_Compare */
|
||||
@@ -3532,7 +3534,7 @@ case OP_Insert: {
|
||||
*/
|
||||
case OP_Delete: {
|
||||
int i = pOp->p1;
|
||||
i64 iKey;
|
||||
i64 iKey = 0;
|
||||
Cursor *pC;
|
||||
|
||||
assert( i>=0 && i<p->nCursor );
|
||||
|
||||
@@ -46,4 +46,16 @@ do_malloc_test attachmalloc-1 -tclprep {
|
||||
CREATE TABLE four.t1(x);
|
||||
}
|
||||
|
||||
set enable_shared_cache [sqlite3_enable_shared_cache 1]
|
||||
sqlite3 dbaux test2.db
|
||||
dbaux eval {SELECT * FROM sqlite_master}
|
||||
do_malloc_test attachmalloc-2 -sqlbody {
|
||||
SELECT * FROM sqlite_master;
|
||||
ATTACH 'test2.db' AS two;
|
||||
} -cleanup {
|
||||
db eval { DETACH two }
|
||||
}
|
||||
dbaux close
|
||||
sqlite3_enable_shared_cache $enable_shared_cache
|
||||
|
||||
finish_test
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ ifcapable pager_pragmas {
|
||||
db eval "PRAGMA page_size=$pagesize"
|
||||
db eval {CREATE TABLE t1(x)}
|
||||
file size test.db
|
||||
} [expr $pagesize*2]
|
||||
} [expr {$pagesize*2<$sqlite_pending_byte ? $pagesize*2 : $pagesize*3}]
|
||||
do_test filefmt-1.5.$pagesize.2 {
|
||||
hexio_get_int [hexio_read test.db 16 2]
|
||||
} $pagesize
|
||||
|
||||
+1
-1
@@ -401,7 +401,7 @@ ifcapable pager_pragmas {
|
||||
# File has grown - showing there was a cache-spill - but there
|
||||
# have been no calls to fsync():
|
||||
list [file size test.db] [nSync]
|
||||
} {31744 0}
|
||||
} {36864 0}
|
||||
do_test io-3.3 {
|
||||
# The COMMIT requires a single fsync() - to the database file.
|
||||
execsql { COMMIT }
|
||||
|
||||
@@ -30,3 +30,5 @@ foreach start {0 100 10000 1000000 0x10000000} {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
||||
Reference in New Issue
Block a user