mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-22 20:22:44 +03:00
Fix the CREATE INDEX statement so that trying to create a TEMP index on
a non-TEMP table throws an error rather than segfaulting. FossilOrigin-Name: e3c8935f8736d00dc83644fa21d86ca7fec6d2fc
This commit is contained in:
@@ -2550,7 +2550,12 @@ Index *sqlite3CreateIndex(
|
||||
pTab = sqlite3LocateTableItem(pParse, 0, &pTblName->a[0]);
|
||||
assert( db->mallocFailed==0 || pTab==0 );
|
||||
if( pTab==0 ) goto exit_create_index;
|
||||
assert( db->aDb[iDb].pSchema==pTab->pSchema );
|
||||
if( iDb==1 && db->aDb[iDb].pSchema!=pTab->pSchema ){
|
||||
sqlite3ErrorMsg(pParse,
|
||||
"cannot create a TEMP index on non-TEMP table \"%s\"",
|
||||
pTab->zName);
|
||||
goto exit_create_index;
|
||||
}
|
||||
}else{
|
||||
assert( pName==0 );
|
||||
assert( pStart==0 );
|
||||
|
||||
Reference in New Issue
Block a user