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

Allow the default value for columns added using ALTER TABLE ADD COLUMN to be a function in existing schemas loaded from disk. But prevent this version of SQLite from being used to create such a column.

FossilOrigin-Name: ff868e22ca0393eaac417872a4c10738f0d7d970
This commit is contained in:
dan
2015-03-11 20:59:42 +00:00
parent 18bf807689
commit cdcc11d7d4
4 changed files with 19 additions and 37 deletions

View File

@@ -690,7 +690,9 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
*/
if( pDflt ){
sqlite3_value *pVal = 0;
if( sqlite3ValueFromExpr(db, pDflt, SQLITE_UTF8, SQLITE_AFF_NONE, &pVal) ){
if( pDflt->op!=TK_FUNCTION
&& sqlite3ValueFromExpr(db, pDflt, SQLITE_UTF8, SQLITE_AFF_NONE, &pVal)
){
db->mallocFailed = 1;
return;
}