Have REINDEX handle missing collation sequences correctly. (CVS 2280)
FossilOrigin-Name: 1c1904f44310fa0e327d8f0a77f1cf97599b630a
This commit is contained in:
parent
536065afef
commit
33a5edc3a4
16
manifest
16
manifest
@ -1,5 +1,5 @@
|
||||
C Propagate\sdetected\sdatabase\scorruption\sup\sthrough\sthe\scall\sstack.\s(CVS\s2279)
|
||||
D 2005-01-26T21:55:32
|
||||
C Have\sREINDEX\shandle\smissing\scollation\ssequences\scorrectly.\s(CVS\s2280)
|
||||
D 2005-01-27T00:22:03
|
||||
F Makefile.in ffd81f5e926d40b457071b4de8d7c1fa18f39b5a
|
||||
F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
|
||||
F README a01693e454a00cc117967e3f9fdab2d4d52e9bc1
|
||||
@ -31,7 +31,7 @@ F src/attach.c f78f76bc6a8e5e487ca53636e21ccba2484a9a61
|
||||
F src/auth.c 4b15c85335417752cc1045eae18b8186e08c8184
|
||||
F src/btree.c e68ae12c8b12ef9d45d58d931c36c184055a3880
|
||||
F src/btree.h 74d19cf40ab49fd69abe9e4e12a6c321ad86c497
|
||||
F src/build.c 91e05a3a5031a72b94696f0ac062aa972d4254ec
|
||||
F src/build.c 7fceb519293cbedd49a675975130722693a0f12b
|
||||
F src/cursor.c de73c00aefc4747ad59b5105cf38bbff0667922e
|
||||
F src/date.c f3d1f5cd1503dabf426a198f3ebef5afbc122a7f
|
||||
F src/delete.c b3accca9c38d9a67dbd724f67b04151a13735ebd
|
||||
@ -170,7 +170,7 @@ F test/printf.test 92ba4c510b4fc61120ffa4a01820446ed917ae57
|
||||
F test/progress.test 16496001da445e6534afb94562c286708316d82f x
|
||||
F test/quick.test 91e5b8ae6663dc9e3e754b271f0384f0cae706e6
|
||||
F test/quote.test 6d75cf635d93ba2484dc9cb378d88cbae9dc2c62
|
||||
F test/reindex.test 3552c6b944a3fab28cfd3049c04c65cb79419757
|
||||
F test/reindex.test 38b138abe36bf9a08c791ed44d9f76cd6b97b78b
|
||||
F test/rollback.test 94cd981ee3a627d9f6466f69dcf1f7dbfe695d7a
|
||||
F test/rowid.test 040a3bef06f970c45f5fcd14b2355f7f4d62f0cf
|
||||
F test/safety.test 907b64fee719554a3622853812af3886fddbbb4f
|
||||
@ -272,7 +272,7 @@ F www/tclsqlite.tcl e73f8f8e5f20e8277619433f7970060ab01088fc
|
||||
F www/vdbe.tcl 095f106d93875c94b47367384ebc870517431618
|
||||
F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
|
||||
F www/whentouse.tcl 3e522a06ad41992023c80ca29a048ae2331ca5bd
|
||||
P db36773830cc81c38b78d1776a495d49475523be
|
||||
R 14737fbdc610c888f2122625dc951acf
|
||||
U drh
|
||||
Z 2ab7fa6f90cabec8fa7c878d19342500
|
||||
P 2c54aba5ba781f4da1f14ed7a3986b6dc17728d7
|
||||
R 27b0ccb0c3d8867cc123414e9dfdc53a
|
||||
U danielk1977
|
||||
Z d33512312c057cff348d67921260de69
|
||||
|
@ -1 +1 @@
|
||||
2c54aba5ba781f4da1f14ed7a3986b6dc17728d7
|
||||
1c1904f44310fa0e327d8f0a77f1cf97599b630a
|
16
src/build.c
16
src/build.c
@ -22,7 +22,7 @@
|
||||
** COMMIT
|
||||
** ROLLBACK
|
||||
**
|
||||
** $Id: build.c,v 1.298 2005/01/24 10:25:59 danielk1977 Exp $
|
||||
** $Id: build.c,v 1.299 2005/01/27 00:22:03 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <ctype.h>
|
||||
@ -2065,6 +2065,14 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Ensure all the required collation sequences are available. This
|
||||
** routine will invoke the collation-needed callback if necessary (and
|
||||
** if one has been registered).
|
||||
*/
|
||||
if( sqlite3CheckIndexCollSeq(pParse, pIndex) ){
|
||||
return;
|
||||
}
|
||||
|
||||
v = sqlite3GetVdbe(pParse);
|
||||
if( v==0 ) return;
|
||||
if( memRootPage>=0 ){
|
||||
@ -2929,6 +2937,12 @@ void sqlite3Reindex(Parse *pParse, Token *pName1, Token *pName2){
|
||||
sqlite3 *db = pParse->db; /* The database connection */
|
||||
Token *pObjName; /* Name of the table or index to be reindexed */
|
||||
|
||||
/* Read the database schema. If an error occurs, leave an error message
|
||||
** and code in pParse and return NULL. */
|
||||
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
|
||||
return 0;
|
||||
}
|
||||
|
||||
if( pName1==0 || pName1->z==0 ){
|
||||
reindexDatabases(pParse, 0);
|
||||
return;
|
||||
|
@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library.
|
||||
# This file implements tests for the REINDEX command.
|
||||
#
|
||||
# $Id: reindex.test,v 1.2 2004/11/07 13:01:50 drh Exp $
|
||||
# $Id: reindex.test,v 1.3 2005/01/27 00:22:04 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -141,4 +141,32 @@ do_test reindex-2.8 {
|
||||
} {ABCD BCDE abc bcd}
|
||||
integrity_check reindex-2.8.1
|
||||
|
||||
# Try to REINDEX an index for which the collation sequence is not available.
|
||||
#
|
||||
do_test reindex-3.1 {
|
||||
sqlite3 db2 test.db
|
||||
catchsql {
|
||||
REINDEX c1;
|
||||
} db2
|
||||
} {1 {no such collation sequence: c1}}
|
||||
do_test reindex-3.2 {
|
||||
proc need_collate {collation} {
|
||||
db2 collate c1 c1
|
||||
}
|
||||
db2 collation_needed need_collate
|
||||
catchsql {
|
||||
REINDEX c1;
|
||||
} db2
|
||||
} {0 {}}
|
||||
do_test reindex-3.3 {
|
||||
catchsql {
|
||||
REINDEX;
|
||||
} db2
|
||||
} {1 {no such collation sequence: c2}}
|
||||
|
||||
do_test reindex-3.99 {
|
||||
db2 close
|
||||
} {}
|
||||
|
||||
finish_test
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user