Merge trunk changes.

FossilOrigin-Name: 90df64ab803001819b3ebbb41d596aedbd9961b1
This commit is contained in:
dan 2012-07-16 10:25:54 +00:00
commit 5ad17e5d03
4 changed files with 89 additions and 12 deletions

View File

@ -1,5 +1,5 @@
C Add\sthe\s"matchlen"\scolumn\sto\sthe\sspellfix1\svirtual\stable.
D 2012-07-13T19:26:34.617
C Merge\strunk\schanges.
D 2012-07-16T10:25:54.662
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 8f6d858bf3df9978ba43df19985146a1173025e4
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -170,7 +170,7 @@ F src/parse.y f29df90bd3adc64b33114ab1de9fb7768fcf2099
F src/pcache.c f8043b433a57aba85384a531e3937a804432a346
F src/pcache.h 1b5dcc3dc8103d03e625b177023ee67764fa6b7c
F src/pcache1.c 2234d84f9c003d800a57f00f8535c91667fa4f6c
F src/pragma.c eee3e3161f82a1e06f632a8d2a82b29ba3c45889
F src/pragma.c 97f9357f0e7e5fb46a2519f14539550aa07db49f
F src/prepare.c 33291b83cca285718048d219c67b8298501fa3a5
F src/printf.c 4a9f882f1c1787a8b494a2987765acf9d97ac21f
F src/random.c cd4a67b3953b88019f8cd4ccd81394a8ddfaba50
@ -642,7 +642,7 @@ F test/pagesize.test 1dd51367e752e742f58e861e65ed7390603827a0
F test/pcache.test 065aa286e722ab24f2e51792c1f093bf60656b16
F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025
F test/permutations.test 2af90e00cea9e7e7c0a6b16d34727cb5bbae14dd
F test/pragma.test cb736bcc75b8b629af21ac0ad83ba1d054a2107b
F test/pragma.test a62f73293b0f0d79b0c87f8dd32d46fe53b0bd17
F test/pragma2.test 3a55f82b954242c642f8342b17dffc8b47472947
F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552
F test/progress.test 5b075c3c790c7b2a61419bc199db87aaf48b8301
@ -1005,10 +1005,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
P cba2a65870481df213e006b07e74f0ca19d2d57c
R 79ffd07a9c878240f73dd72d96e3ef36
T *branch * spellfix-matchlen
T *sym-spellfix-matchlen *
T -sym-trunk *
P f24b9d87f6b0e8b4d26669d5c1191f9280ba14a3 4353e40b74f577f224f190c429bfe03cf6a5c6d6
R 41982e9e09fbd84544b16a8024815a54
U dan
Z 642149d4a86bbb287ab54c68c79dc818
Z df39f17a0a50d7df733c6d4551aaf8e2

View File

@ -1 +1 @@
f24b9d87f6b0e8b4d26669d5c1191f9280ba14a3
90df64ab803001819b3ebbb41d596aedbd9961b1

View File

@ -1160,6 +1160,19 @@ void sqlite3Pragma(
int isQuick = (sqlite3Tolower(zLeft[0])=='q');
/* If the PRAGMA command was of the form "PRAGMA <db>.integrity_check",
** then iDb is set to the index of the database identified by <db>.
** In this case, the integrity of database iDb only is verified by
** the VDBE created below.
**
** Otherwise, if the command was simply "PRAGMA integrity_check" (or
** "PRAGMA quick_check"), then iDb is set to 0. In this case, set iDb
** to -1 here, to indicate that the VDBE should verify the integrity
** of all attached databases. */
assert( iDb>=0 );
assert( iDb==0 || pId2->z );
if( pId2->z==0 ) iDb = -1;
/* Initialize the VDBE program */
if( sqlite3ReadSchema(pParse) ) goto pragma_out;
pParse->nMem = 6;
@ -1183,6 +1196,7 @@ void sqlite3Pragma(
int cnt = 0;
if( OMIT_TEMPDB && i==1 ) continue;
if( iDb>=0 && i!=iDb ) continue;
sqlite3CodeVerifySchema(pParse, i);
addr = sqlite3VdbeAddOp1(v, OP_IfPos, 1); /* Halt if out of errors */
@ -1194,7 +1208,7 @@ void sqlite3Pragma(
** Begin by filling registers 2, 3, ... with the root pages numbers
** for all tables and indices in the database.
*/
assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
assert( sqlite3SchemaMutexHeld(db, i, 0) );
pTbls = &db->aDb[i].pSchema->tblHash;
for(x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){
Table *pTab = sqliteHashData(x);

View File

@ -16,6 +16,7 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix pragma
# Do not use a codec for tests in this file, as the database file is
# manipulated directly using tcl scripts (using the [hexio_write] command).
@ -41,6 +42,8 @@ do_not_use_codec
# reset when the schema is reloaded.
# pragma-16.*: Test proxy locking
# pragma-20.*: Test data_store_directory.
# pragma-22.*: Test that "PRAGMA [db].integrity_check" respects the "db"
# directive - if it is present.
#
ifcapable !pragma {
@ -1554,4 +1557,67 @@ do_test pragma-20.8 {
forcedelete data_dir
} ;# endif windows
do_test 21.1 {
# Create a corrupt database in testerr.db. And a non-corrupt at test.db.
#
db close
forcedelete test.db
sqlite3 db test.db
execsql {
PRAGMA page_size = 1024;
PRAGMA auto_vacuum = 0;
CREATE TABLE t1(a PRIMARY KEY, b);
INSERT INTO t1 VALUES(1, 1);
}
for {set i 0} {$i < 10} {incr i} {
execsql { INSERT INTO t1 SELECT a + (1 << $i), b + (1 << $i) FROM t1 }
}
db close
forcecopy test.db testerr.db
hexio_write testerr.db 15000 [string repeat 55 100]
} {100}
set mainerr {*** in database main ***
Multiple uses for byte 672 of page 15}
set auxerr {*** in database aux ***
Multiple uses for byte 672 of page 15}
do_test 22.2 {
catch { db close }
sqlite3 db testerr.db
execsql { PRAGMA integrity_check }
} [list $mainerr]
do_test 22.3.1 {
catch { db close }
sqlite3 db test.db
execsql {
ATTACH 'testerr.db' AS 'aux';
PRAGMA integrity_check;
}
} [list $auxerr]
do_test 22.3.2 {
execsql { PRAGMA main.integrity_check; }
} {ok}
do_test 22.3.3 {
execsql { PRAGMA aux.integrity_check; }
} [list $auxerr]
do_test 22.4.1 {
catch { db close }
sqlite3 db testerr.db
execsql {
ATTACH 'test.db' AS 'aux';
PRAGMA integrity_check;
}
} [list $mainerr]
do_test 22.4.2 {
execsql { PRAGMA main.integrity_check; }
} [list $mainerr]
do_test 22.4.3 {
execsql { PRAGMA aux.integrity_check; }
} {ok}
finish_test