1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

When parsing CREATE INDEX statements from the sqlite_master table, do not search the temp database schema for the corresponding table. Only consider the database for which the schema is being parsed. Ticket #2817. (CVS 4587)

FossilOrigin-Name: e6f02aa5ae6da0befdf98fdd5884345f3cb7f5ea
This commit is contained in:
danielk1977
2007-12-02 11:46:34 +00:00
parent 0c1cddbe86
commit fe91033907
4 changed files with 90 additions and 13 deletions

View File

@@ -22,7 +22,7 @@
** COMMIT
** ROLLBACK
**
** $Id: build.c,v 1.448 2007/11/12 09:50:26 danielk1977 Exp $
** $Id: build.c,v 1.449 2007/12/02 11:46:35 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -2320,11 +2320,14 @@ void sqlite3CreateIndex(
#ifndef SQLITE_OMIT_TEMPDB
/* If the index name was unqualified, check if the the table
** is a temp table. If so, set the database to 1.
** is a temp table. If so, set the database to 1. Do not do this
** if initialising a database schema.
*/
pTab = sqlite3SrcListLookup(pParse, pTblName);
if( pName2 && pName2->n==0 && pTab && pTab->pSchema==db->aDb[1].pSchema ){
iDb = 1;
if( !db->init.busy ){
pTab = sqlite3SrcListLookup(pParse, pTblName);
if( pName2 && pName2->n==0 && pTab && pTab->pSchema==db->aDb[1].pSchema ){
iDb = 1;
}
}
#endif