You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1.open a db,
2.create a couple tables
3.add some foreign keys and enable them
4 attempt to alter table by renaming it. you'll get an SQL Error or database
not loaded.
What is the expected output? What do you see instead?
Success! failure :(
What version of the product are you using? On what operating system?
Not sure. OSX
Please provide any additional information below.
Problem is in alter_cs line 588 (currently)
if ( ( zWhere = whereForeignKeys( pParse, pTab ) ) != null )
and the whereForeignKeys:
static string whereForeignKeys( Parse pParse, Table pTab )
{
FKey p;
string zWhere = "";
for ( p = sqlite3FkReferences( pTab ); p != null; p = p.pNextTo )
{
zWhere = whereOrName( pParse.db, zWhere, p.pFrom.zName );
}
return zWhere;
}
where zWhere will never ever be null! it will enter the if statement and will
attempt to update nested foreign keys:
sqlite3NestedParse( pParse,
"UPDATE \"%w\".%s SET " +
"sql = sqlite_rename_parent(sql, %Q, %Q) " +
"WHERE %s;", zDb, SCHEMA_TABLE( iDb ), zTabName, zName, zWhere );
These don't even exist and cause a crash.
To fix set zWhere to null on whereForeignKeys
Original issue reported on code.google.com by [email protected] on 31 Mar 2014 at 9:36
The text was updated successfully, but these errors were encountered:
temptriggers probably had this problem and it switched to compare with the
empty string. another possible solution although I prefer setting things to
null.
Original issue reported on code.google.com by
[email protected]
on 31 Mar 2014 at 9:36The text was updated successfully, but these errors were encountered: