mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-18 10:21:03 +03:00
Have REINDEX handle missing collation sequences correctly. (CVS 2280)
FossilOrigin-Name: 1c1904f44310fa0e327d8f0a77f1cf97599b630a
This commit is contained in:
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;
|
||||
|
||||
Reference in New Issue
Block a user