diff options
author | drh <drh@noemail.net> | 2009-03-18 10:36:12 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2009-03-18 10:36:12 +0000 |
commit | 0bb1221eed2b23879b4e04d7c746e5d82fb07763 (patch) | |
tree | 72186c3fae1124dd6e3d39161ef73d1dca67104e /src/expr.c | |
parent | bd43455c38df92e56ddbf75912672e0098f9e9c0 (diff) | |
download | sqlite-0bb1221eed2b23879b4e04d7c746e5d82fb07763.tar.gz sqlite-0bb1221eed2b23879b4e04d7c746e5d82fb07763.zip |
Add comments and testcase() macros to the fix for shared-cache schema default
value problem of check-in (6353). (CVS 6356)
FossilOrigin-Name: 05d8607d44cd3ff262c07cc1192f4471f3192b09
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/expr.c b/src/expr.c index fac004662..a7a954c09 100644 --- a/src/expr.c +++ b/src/expr.c @@ -12,7 +12,7 @@ ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** -** $Id: expr.c,v 1.419 2009/03/17 17:49:00 danielk1977 Exp $ +** $Id: expr.c,v 1.420 2009/03/18 10:36:13 drh Exp $ */ #include "sqliteInt.h" @@ -649,11 +649,22 @@ void sqlite3DequoteExpr(sqlite3 *db, Expr *p){ return; } ExprSetProperty(p, EP_Dequoted); + + /* If p->token.dyn==0 and none of EP_Reduced, EP_TokenOnly, or + ** EP_SpanOnly are set, that means that the p->token.z string points + ** back to the original SQL statement text. In that case, we need + ** to make a copy before modifying the string, otherwise we would + ** corrupt the original SQL statement text. + */ + testcase( p->token.dyn==0 && ExprHasProperty(p, EP_Reduced) ); + testcase( p->token.dyn==0 && ExprHasProperty(p, EP_TokenOnly) ); + testcase( p->token.dyn==0 && ExprHasProperty(p, EP_SpanOnly) ); if( p->token.dyn==0 && !ExprHasAnyProperty(p, EP_Reduced|EP_TokenOnly|EP_SpanOnly) ){ sqlite3TokenCopy(db, &p->token, &p->token); } + sqlite3Dequote((char*)p->token.z); } |