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

Reload the entire schema after renaming a column in order to ensure that the

schema for any tables for which parent key definitions were changed are
reloaded.

FossilOrigin-Name: f4497b0136e9fcb1121a834c86f84eeaf8f1e7d3157d409484e086bcef3487f1
This commit is contained in:
dan
2018-08-11 13:40:20 +00:00
parent 5da06d3d7e
commit e325ffed04
7 changed files with 28 additions and 16 deletions

View File

@@ -831,9 +831,12 @@ void sqlite3AlterRenameColumn(
zDb, MASTER_NAME, iCol, zNew, pTab->zName, zOld, pTab->zName
);
/* Drop and reload the internal table schema. */
sqlite3ChangeCookie(pParse, iSchema);
reloadTableSchema(pParse, pTab, pTab->zName);
/* Drop and reload the database schema. */
if( db->mallocFailed==0 ){
assert( pParse->pVdbe );
sqlite3ChangeCookie(pParse, iSchema);
sqlite3VdbeAddParseSchemaOp(pParse->pVdbe, iSchema, 0);
}
exit_rename_column:
sqlite3SrcListDelete(db, pSrc);