1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

The implementation of sqlite_rename_column() must be holding the

schema mutexes.

FossilOrigin-Name: f0eed21d4e2e1f2c8e680a510a283ac21156c9766efec5b80a362a040424bce7
This commit is contained in:
drh
2018-08-25 02:04:05 +00:00
parent aa42e9816b
commit da76adc085
3 changed files with 14 additions and 9 deletions

View File

@@ -1209,8 +1209,12 @@ static void renameColumnFunc(
if( zTable==0 ) return;
if( zNew==0 ) return;
if( iCol<0 ) return;
sqlite3BtreeEnterAll(db);
pTab = sqlite3FindTable(db, zTable, zDb);
if( pTab==0 || iCol>=pTab->nCol ) return;
if( pTab==0 || iCol>=pTab->nCol ){
sqlite3BtreeLeaveAll(db);
return;
}
zOld = pTab->aCol[iCol].zName;
memset(&sCtx, 0, sizeof(sCtx));
sCtx.iCol = ((iCol==pTab->iPKey) ? -1 : iCol);
@@ -1476,6 +1480,7 @@ renameColumnFunc_done:
sqlite3DbFree(db, sParse.zErrMsg);
sqlite3ParserReset(&sParse);
sqlite3_free(zQuot);
sqlite3BtreeLeaveAll(db);
}
/*