diff options
author | drh <drh@noemail.net> | 2009-05-28 01:00:55 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2009-05-28 01:00:55 +0000 |
commit | 33e619fc1c938c1cee5f390671f12d70ffb203dd (patch) | |
tree | 154221bcd11ffa6405e6fa5b5b396f141fe63a67 /src/build.c | |
parent | b7916a78ff7708161b6e2de54af5aea85a07c543 (diff) | |
download | sqlite-33e619fc1c938c1cee5f390671f12d70ffb203dd.tar.gz sqlite-33e619fc1c938c1cee5f390671f12d70ffb203dd.zip |
Additional refinements to Expr handling. Restore compression of trigger
expressions. Change Expr.zToken to Expr.u.zToken and added Expr.u.iValue.
Remove an unnecessary ExprDup from CHECK constraint processing. And so forth. (CVS 6682)
FossilOrigin-Name: 4ac2bdfbb4230b6ceaae87e738fa61036bbe03cb
Diffstat (limited to 'src/build.c')
-rw-r--r-- | src/build.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/build.c b/src/build.c index 66f932e6e..ce8385992 100644 --- a/src/build.c +++ b/src/build.c @@ -22,7 +22,7 @@ ** COMMIT ** ROLLBACK ** -** $Id: build.c,v 1.545 2009/05/27 10:31:29 drh Exp $ +** $Id: build.c,v 1.546 2009/05/28 01:00:55 drh Exp $ */ #include "sqliteInt.h" @@ -1181,14 +1181,12 @@ void sqlite3AddCheckConstraint( #ifndef SQLITE_OMIT_CHECK Table *pTab = pParse->pNewTable; if( pTab && !IN_DECLARE_VTAB ){ - /* The CHECK expression must be duplicated so that tokens refer - ** to malloced space and not the (ephemeral) text of the CREATE TABLE - ** statement */ - pTab->pCheck = sqlite3ExprAnd(db, pTab->pCheck, - sqlite3ExprDup(db, pCheckExpr, 0)); - } + pTab->pCheck = sqlite3ExprAnd(db, pTab->pCheck, pCheckExpr); + }else #endif - sqlite3ExprDelete(db, pCheckExpr); + { + sqlite3ExprDelete(db, pCheckExpr); + } } /* |