aboutsummaryrefslogtreecommitdiff
path: root/src/build.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/build.c')
-rw-r--r--src/build.c14
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);
+ }
}
/*