diff options
-rw-r--r-- | manifest | 36 | ||||
-rw-r--r-- | manifest.uuid | 2 | ||||
-rw-r--r-- | src/analyze.c | 4 | ||||
-rw-r--r-- | src/build.c | 2 | ||||
-rw-r--r-- | src/expr.c | 2 | ||||
-rw-r--r-- | src/func.c | 2 | ||||
-rw-r--r-- | src/os_unix.c | 2 | ||||
-rw-r--r-- | src/pager.c | 3 | ||||
-rw-r--r-- | src/resolve.c | 4 | ||||
-rw-r--r-- | src/test_quota.c | 2 | ||||
-rw-r--r-- | src/test_regexp.c | 2 | ||||
-rw-r--r-- | src/test_spellfix.c | 12 | ||||
-rw-r--r-- | src/vdbeapi.c | 2 | ||||
-rw-r--r-- | test/incrvacuum3.test | 21 | ||||
-rw-r--r-- | test/tkt-7a31705a7e6.test | 26 |
15 files changed, 82 insertions, 40 deletions
@@ -1,5 +1,5 @@ C Prevent\sTcl\sfile\sencoding\sissues\sin\sthe\stests\sfor\sthe\sunicode()\sand\schar()\sfunctions. -D 2013-02-26T05:44:33.955 +D 2013-03-01T23:13:37.546 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in a48faa9e7dd7d556d84f5456eabe5825dd8a6282 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -115,7 +115,7 @@ F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b F sqlite3.1 6be1ad09113570e1fc8dcaff84c9b0b337db5ffc F sqlite3.pc.in ae6f59a76e862f5c561eb32a380228a02afc3cad F src/alter.c f8db986c03eb0bfb221523fc9bbb9d0b70de3168 -F src/analyze.c 7553068d21e32a57fc33ab6b2393fc8c1ba41410 +F src/analyze.c d5f895810e8ff9737c9ec7b76abc3dcff5860335 F src/attach.c ea5247f240e2c08afd608e9beb380814b86655e1 F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34 F src/backup.c b2cac9f7993f3f9588827b824b1501d0c820fa68 @@ -124,16 +124,16 @@ F src/btmutex.c 976f45a12e37293e32cae0281b15a21d48a8aaa7 F src/btree.c cbad71970cfadfa342fc137ca5e319f98b2d0da1 F src/btree.h 3ad7964d6c5b1c7bff569aab6adfa075f8bf06cd F src/btreeInt.h eecc84f02375b2bb7a44abbcbbe3747dde73edb2 -F src/build.c 73ca65f32938e4e0d94e831b61b5749b211b79be +F src/build.c 375e5df716e03b9343c5e1211be3b24e6d6dff05 F src/callback.c d7e46f40c3cf53c43550b7da7a1d0479910b62cc F src/complete.c dc1d136c0feee03c2f7550bafc0d29075e36deac F src/ctime.c 72a70dcfda75d3a1f81041ce4573e7afddcd8e4e F src/date.c 067a81c9942c497aafd2c260e13add8a7d0c7dd4 F src/delete.c 9b8d308979114991e5dc7cee958316e07186941d -F src/expr.c f6c20285bd36e87ec47f4d840e90a32755e2a90c +F src/expr.c a23b4aac2a455b2e76b55bef5dcfbe62b665375c F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb F src/fkey.c e16942bd5c8a868ac53287886464a5ed0e72b179 -F src/func.c cac45cca7bbe29bbefef46116174e89e1284763b +F src/func.c b45b6a171511e3a8e50bf6f8503e54a76f608e02 F src/global.c e59ecd2c553ad0d4bfbc84ca71231336f8993a7a F src/hash.c ac3470bbf1ca4ae4e306a8ecb0fdf1731810ffe4 F src/hash.h 2894c932d84d9f892d4b4023a75e501f83050970 @@ -160,9 +160,9 @@ F src/notify.c 976dd0f6171d4588e89e874fcc765e92914b6d30 F src/os.c e1acdc09ff3ac2412945cca9766e2dcf4675f31c F src/os.h 027491c77d2404c0a678bb3fb06286f331eb9b57 F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04 -F src/os_unix.c dfdc04b126f7b05dcb2e2cc5c1262f98acbb49d9 +F src/os_unix.c 8964f621aaab1f2c9804fbbff4450d9811ef5548 F src/os_win.c eabd00b813577d36bd66271cb08dd64ea0589dac -F src/pager.c 0dbf5ff5d5d7d3a21fcab82e9e4d129b6fe6314f +F src/pager.c 9e51c2a37a2f2c3ed4689c25204e2977b5450ac0 F src/pager.h 1109a06578ec5574dc2c74cf8d9f69daf36fe3e0 F src/parse.y 5d5e12772845805fdfeb889163516b84fbb9ae95 F src/pcache.c f8043b433a57aba85384a531e3937a804432a346 @@ -172,7 +172,7 @@ F src/pragma.c bdb484d0283965c431d4153f28c30f836a1f16b1 F src/prepare.c 931ad0d852a0df48f79adcba6ce79ca5f475625c F src/printf.c 4a9f882f1c1787a8b494a2987765acf9d97ac21f F src/random.c cd4a67b3953b88019f8cd4ccd81394a8ddfaba50 -F src/resolve.c 652ae6dc0f185b01b4536bb2fa7d878f13f0f1df +F src/resolve.c 9079da7d59aed2bb14ec8315bc7f720dd85b5b65 F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0 F src/select.c e1c6f6abdf9f359f4e735cb8ae11d2f359bf52a9 F src/shell.c 7c41bfcd9e5bf9d96b9215f79b03a5b2b44a3bca @@ -216,13 +216,13 @@ F src/test_mutex.c a6bd7b9cf6e19d989e31392b06ac8d189f0d573e F src/test_onefile.c 0396f220561f3b4eedc450cef26d40c593c69a25 F src/test_osinst.c 90a845c8183013d80eccb1f29e8805608516edba F src/test_pcache.c a5cd24730cb43c5b18629043314548c9169abb00 -F src/test_quota.c 0e0e2e3bf6766b101ecccd8c042b66e44e9be8f5 +F src/test_quota.c 1ec82e02fd3643899e9a5de9684515e84641c91f F src/test_quota.h 8761e463b25e75ebc078bd67d70e39b9c817a0cb -F src/test_regexp.c 58e0349f155bc307dfa209df4b03add0a7749866 +F src/test_regexp.c 08748a68ddb3b29329dbdade5ede849a749f0c07 F src/test_rtree.c aba603c949766c4193f1068b91c787f57274e0d9 F src/test_schema.c 8c06ef9ddb240c7a0fcd31bc221a6a2aade58bf0 F src/test_server.c 2f99eb2837dfa06a4aacf24af24c6affdf66a84f -F src/test_spellfix.c 83abe9d8c364cdd5f93bc06eaf40a349ebbf6c5c +F src/test_spellfix.c 56dfa6d583ac34f61af0834d7b58d674e7e18e13 F src/test_sqllog.c 8acb843ddb9928dea8962e31bb09f421a72ffccb F src/test_stat.c d1569c7a4839f13e80187e2c26b2ab4da2d03935 F src/test_superlock.c 2b97936ca127d13962c3605dbc9a4ef269c424cd @@ -242,7 +242,7 @@ F src/vacuum.c 2727bdd08847fcb6b2d2da6d14f018910e8645d3 F src/vdbe.c 292f8f7ced59c29c63fe17830cbe5f5a0230cdf0 F src/vdbe.h b52887278cb173e66188da84dfab216bea61119d F src/vdbeInt.h 396bb03eec560f768d1b86092b00f46c25575d3b -F src/vdbeapi.c 4c2418161cf45392ba76a7ca92f9a5f06b96f89c +F src/vdbeapi.c 9616986209cc77822aa9f7d91cf9e6880516d557 F src/vdbeaux.c 735a6905df302a7f3c715a82bd3af06dc7d74ef2 F src/vdbeblob.c 32f2a4899d67f69634ea4dd93e3f651936d732cb F src/vdbemem.c cb55e84b8e2c15704968ee05f0fae25883299b74 @@ -534,7 +534,7 @@ F test/incrblob_err.test d2562d2771ebffd4b3af89ef64c140dd44371597 F test/incrblobfault.test 917c0292224c64a56ef7215fd633a3a82f805be0 F test/incrvacuum.test d2a6ddf5e429720b5fe502766af747915ccf6c32 F test/incrvacuum2.test 379eeb8740b0ef60c372c439ad4cbea20b34bb9b -F test/incrvacuum3.test 1159ec2b3e7bafbde5718867bc7328ba58863313 +F test/incrvacuum3.test 2ffa9e4a23f072bd7902b9ae6471f8822a6522a7 F test/incrvacuum_ioerr.test 293f2714571255539c8c789da2f7de4ec3f7101e F test/index.test b5429732b3b983fa810e3ac867d7ca85dae35097 F test/index2.test ee83c6b5e3173a3d7137140d945d9a5d4fdfb9d6 @@ -784,6 +784,7 @@ F test/tkt-5e10420e8d.test 904d1687b3c06d43e5b3555bbcf6802e7c0ffd84 F test/tkt-5ee23731f.test 9db6e1d7209dc0794948b260d6f82b2b1de83a9f F test/tkt-752e1646fc.test ea78d88d14fe9866bdd991c634483334639e13bf F test/tkt-78e04e52ea.test 703e0bfb23d543edf0426a97e3bbd0ca346508ec +F test/tkt-7a31705a7e6.test 5a7889fdb095ffbe1622413e0145de1637d421bd F test/tkt-7bbfb7d442.test dfa5c8097a8c353ae40705d6cddeb1f99c18b81a F test/tkt-80ba201079.test 105a721e6aad0ae3c5946d7615d1e4d03f6145b8 F test/tkt-80e031a00f.test 9a154173461a4dbe2de49cda73963e04842d52f7 @@ -1035,10 +1036,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac -P 6d7973524a7d3bf3158fdac58975945da7f51740 -R 49ff1f2b0a98496405857ab66db0f4ad -T *branch * funcTestEncoding -T *sym-funcTestEncoding * -T -sym-trunk * +P f476eace86102fd5442cfbba169c18f6ee44eae2 d2e7dfca5a92074a7984032deb6a4e3681389c72 +R 8f643957234789baf5ec785ee72ea00a U mistachkin -Z 6ef7a794e2bcbed68706686e53ccd98f +Z d27776955493f492e2d5a7d687e61dbc diff --git a/manifest.uuid b/manifest.uuid index bcd57415c..c73ceed14 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d2e7dfca5a92074a7984032deb6a4e3681389c72
\ No newline at end of file +c9c2b82c86fff457a0b32d5be84ec66639065ae1
\ No newline at end of file diff --git a/src/analyze.c b/src/analyze.c index 632fdc1ac..9a3e9597d 100644 --- a/src/analyze.c +++ b/src/analyze.c @@ -473,7 +473,7 @@ static void analyzeOneTable( /* Do not gather statistics on views or virtual tables */ return; } - if( memcmp(pTab->zName, "sqlite_", 7)==0 ){ + if( sqlite3_strnicmp(pTab->zName, "sqlite_", 7)==0 ){ /* Do not gather statistics on system tables */ return; } @@ -883,7 +883,7 @@ static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){ if( pIndex==0 ) break; pIndex->aiRowEst[i] = v; if( *z==' ' ) z++; - if( memcmp(z, "unordered", 10)==0 ){ + if( strcmp(z, "unordered")==0 ){ pIndex->bUnordered = 1; break; } diff --git a/src/build.c b/src/build.c index 4ce65a43d..5d063f072 100644 --- a/src/build.c +++ b/src/build.c @@ -2594,7 +2594,7 @@ Index *sqlite3CreateIndex( assert( pTab!=0 ); assert( pParse->nErr==0 ); if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 - && memcmp(&pTab->zName[7],"altertab_",9)!=0 ){ + && sqlite3StrNICmp(&pTab->zName[7],"altertab_",9)!=0 ){ sqlite3ErrorMsg(pParse, "table %s may not be indexed", pTab->zName); goto exit_create_index; } diff --git a/src/expr.c b/src/expr.c index 5de468e21..4f38ab0a4 100644 --- a/src/expr.c +++ b/src/expr.c @@ -638,7 +638,7 @@ void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){ */ ynVar i; for(i=0; i<pParse->nzVar; i++){ - if( pParse->azVar[i] && memcmp(pParse->azVar[i],z,n+1)==0 ){ + if( pParse->azVar[i] && strcmp(pParse->azVar[i],z)==0 ){ pExpr->iColumn = x = (ynVar)i+1; break; } diff --git a/src/func.c b/src/func.c index 43a338ed3..09453b3c6 100644 --- a/src/func.c +++ b/src/func.c @@ -999,10 +999,10 @@ static void charFunc( if( x<0 || x>0x10ffff ) x = 0xfffd; c = (unsigned)(x & 0x1fffff); if( c<=0xFFFF ){ + if( c>=0xd800 && c<=0xdfff ) c = 0xfffd; *zOut++ = (u8)(c&0x00FF); *zOut++ = (u8)((c>>8)&0x00FF); }else{ - if( c>=0xd800 && c<=0xdbff ) c = 0xfffd; *zOut++ = (u8)(((c>>10)&0x003F) + (((c-0x10000)>>10)&0x00C0)); *zOut++ = (u8)(0x00D8 + (((c-0x10000)>>18)&0x03)); *zOut++ = (u8)(c&0x00FF); diff --git a/src/os_unix.c b/src/os_unix.c index dc13be186..fca2f703d 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -4752,7 +4752,7 @@ static int fillInUnixFile( "psow", SQLITE_POWERSAFE_OVERWRITE) ){ pNew->ctrlFlags |= UNIXFILE_PSOW; } - if( memcmp(pVfs->zName,"unix-excl",10)==0 ){ + if( strcmp(pVfs->zName,"unix-excl")==0 ){ pNew->ctrlFlags |= UNIXFILE_EXCL; } diff --git a/src/pager.c b/src/pager.c index 863368f59..7acb7fd43 100644 --- a/src/pager.c +++ b/src/pager.c @@ -6451,7 +6451,8 @@ int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, int isCommit){ */ if( (pPg->flags&PGHDR_NEED_SYNC) && !isCommit ){ needSyncPgno = pPg->pgno; - assert( pageInJournal(pPg) || pPg->pgno>pPager->dbOrigSize ); + assert( pPager->journalMode==PAGER_JOURNALMODE_OFF || + pageInJournal(pPg) || pPg->pgno>pPager->dbOrigSize ); assert( pPg->flags&PGHDR_DIRTY ); } diff --git a/src/resolve.c b/src/resolve.c index f8cd9e5ab..038013867 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -165,12 +165,12 @@ int sqlite3MatchSpanName( ){ int n; for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){} - if( zDb && sqlite3StrNICmp(zSpan, zDb, n)!=0 ){ + if( zDb && (sqlite3StrNICmp(zSpan, zDb, n)!=0 || zDb[n]!=0) ){ return 0; } zSpan += n+1; for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){} - if( zTab && sqlite3StrNICmp(zSpan, zTab, n)!=0 ){ + if( zTab && (sqlite3StrNICmp(zSpan, zTab, n)!=0 || zTab[n]!=0) ){ return 0; } zSpan += n+1; diff --git a/src/test_quota.c b/src/test_quota.c index 166a512f1..58169e17c 100644 --- a/src/test_quota.c +++ b/src/test_quota.c @@ -1295,7 +1295,7 @@ int sqlite3_quota_remove(const char *zFilename){ if( pGroup ){ for(pFile=pGroup->pFiles; pFile && rc==SQLITE_OK; pFile=pNextFile){ pNextFile = pFile->pNext; - diff = memcmp(zFull, pFile->zFilename, nFull); + diff = strncmp(zFull, pFile->zFilename, nFull); if( diff==0 && ((c = pFile->zFilename[nFull])==0 || c=='/' || c=='\\') ){ if( pFile->nRef ){ pFile->deleteOnClose = 1; diff --git a/src/test_regexp.c b/src/test_regexp.c index 321417b88..2cebbea44 100644 --- a/src/test_regexp.c +++ b/src/test_regexp.c @@ -194,7 +194,7 @@ int re_match(ReCompiled *pRe, const unsigned char *zIn, int nIn){ if( pRe->nInit ){ unsigned char x = pRe->zInit[0]; while( in.i+pRe->nInit<=in.mx - && (zIn[in.i]!=x || memcmp(zIn+in.i, pRe->zInit, pRe->nInit)!=0) + && (zIn[in.i]!=x || strncmp(zIn+in.i, pRe->zInit, pRe->nInit)!=0) ){ in.i++; } diff --git a/src/test_spellfix.c b/src/test_spellfix.c index f294f48c6..16376244a 100644 --- a/src/test_spellfix.c +++ b/src/test_spellfix.c @@ -744,22 +744,22 @@ static int utf8Len(unsigned char c, int N){ } /* -** Return TRUE (non-zero) of the To side of the given cost matches +** Return TRUE (non-zero) if the To side of the given cost matches ** the given string. */ static int matchTo(EditDist3Cost *p, const char *z, int n){ if( p->nTo>n ) return 0; - if( memcmp(p->a+p->nFrom, z, p->nTo)!=0 ) return 0; + if( strncmp(p->a+p->nFrom, z, p->nTo)!=0 ) return 0; return 1; } /* -** Return TRUE (non-zero) of the To side of the given cost matches +** Return TRUE (non-zero) if the From side of the given cost matches ** the given string. */ static int matchFrom(EditDist3Cost *p, const char *z, int n){ assert( p->nFrom<=n ); - if( memcmp(p->a, z, p->nFrom)!=0 ) return 0; + if( strncmp(p->a, z, p->nFrom)!=0 ) return 0; return 1; } @@ -1952,7 +1952,7 @@ static int spellfix1Init( ); } for(i=3; rc==SQLITE_OK && i<argc; i++){ - if( memcmp(argv[i],"edit_cost_table=",16)==0 && pNew->zCostTable==0 ){ + if( strncmp(argv[i],"edit_cost_table=",16)==0 && pNew->zCostTable==0 ){ pNew->zCostTable = spellfix1Dequote(&argv[i][16]); if( pNew->zCostTable==0 ) rc = SQLITE_NOMEM; continue; @@ -2681,7 +2681,7 @@ static int spellfix1Update( p->pConfig3 = 0; return SQLITE_OK; } - if( memcmp(zCmd,"edit_cost_table=",16)==0 ){ + if( strncmp(zCmd,"edit_cost_table=",16)==0 ){ editDist3ConfigDelete(p->pConfig3); p->pConfig3 = 0; sqlite3_free(p->zCostTable); diff --git a/src/vdbeapi.c b/src/vdbeapi.c index b48826680..ae3ce2390 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -1198,7 +1198,7 @@ int sqlite3VdbeParameterIndex(Vdbe *p, const char *zName, int nName){ if( zName ){ for(i=0; i<p->nzVar; i++){ const char *z = p->azVar[i]; - if( z && memcmp(z,zName,nName)==0 && z[nName]==0 ){ + if( z && strncmp(z,zName,nName)==0 && z[nName]==0 ){ return i+1; } } diff --git a/test/incrvacuum3.test b/test/incrvacuum3.test index ed2d47139..f01dc100b 100644 --- a/test/incrvacuum3.test +++ b/test/incrvacuum3.test @@ -34,9 +34,8 @@ ifcapable {!autovacuum || !pragma} { proc check_on_disk {} { - # Copy the files for database "test.db" to "test2.db". + # Copy the wal and journal files for database "test.db" to "test2.db". forcedelete test2.db test2.db-journal test2.db-wal - forcecopy test.db test2.db if {[file exists test.db-journal]} { forcecopy test.db-journal test2.db-journal } @@ -44,6 +43,24 @@ proc check_on_disk {} { forcecopy test.db-wal test2.db-wal } + # Now copy the database file itself. Do this using open/read/puts + # instead of the [file copy] command in order to avoid attempting + # to read the 512 bytes begining at offset $sqlite_pending_byte. + # + set sz [file size test.db] + set fd [open test.db] + set fd2 [open test2.db w] + fconfigure $fd -encoding binary -translation binary + fconfigure $fd2 -encoding binary -translation binary + if {$sz>$::sqlite_pending_byte} { + puts -nonewline $fd2 [read $fd $::sqlite_pending_byte] + seek $fd [expr $::sqlite_pending_byte+512] + seek $fd2 [expr $::sqlite_pending_byte+512] + } + puts -nonewline $fd2 [read $fd] + close $fd2 + close $fd + # Open "test2.db" and check it is Ok. sqlite3 dbcheck test2.db set ret [dbcheck eval { PRAGMA integrity_check }] diff --git a/test/tkt-7a31705a7e6.test b/test/tkt-7a31705a7e6.test new file mode 100644 index 000000000..64701220a --- /dev/null +++ b/test/tkt-7a31705a7e6.test @@ -0,0 +1,26 @@ +# 2013 February 26 +# +# 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. Specifically, +# it tests that ticket [7a31705a7e6c95d514e6f20a6900f436bbc9fed8] in the +# name resolver has been fixed. +# + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + +do_execsql_test tkt-7a31705a7e6-1.1 { + CREATE TABLE t1 (a INTEGER PRIMARY KEY); + CREATE TABLE t2 (a INTEGER PRIMARY KEY, b INTEGER); + CREATE TABLE t2x (b INTEGER PRIMARY KEY); + SELECT t1.a FROM ((t1 JOIN t2 ON t1.a=t2.a) AS x JOIN t2x ON x.b=t2x.b) as y; +} {} + |