/ Check-in [48775ec6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a potential NULL pointer deref following OOM in the new IS TRUE logic.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 48775ec693c21927ff26448acc614dd67d56240fa263499da2a9fe405c546c32
User & Date: drh 2018-02-28 04:30:55
Context
2018-02-28
21:50
Use <pre> around code snippets in the documentation for sessions interfaces. This is a documentation change only with no changes to code. check-in: c949b915 user: drh tags: trunk
04:30
Fix a potential NULL pointer deref following OOM in the new IS TRUE logic. check-in: 48775ec6 user: drh tags: trunk
2018-02-27
15:40
Add support for TRUE and FALSE keywords and for operators IS TRUE, IS FALSE, IS NOT TRUE, and IS NOT FALSE. If there is are columns named TRUE or FALSE, then the keywords resolve to the column names, for compatibility. The behavior of the "DEFAULT true" phrase is changed to mean what it says, rather than being an alias for "DEFAULT 'true'". check-in: 9a7f02c5 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/parse.y.

   309    309                               {sqlite3AddDefaultValue(pParse,X,A.z,Z);}
   310    310   ccons ::= DEFAULT MINUS(A) term(X) scanpt(Z).      {
   311    311     Expr *p = sqlite3PExpr(pParse, TK_UMINUS, X, 0);
   312    312     sqlite3AddDefaultValue(pParse,p,A.z,Z);
   313    313   }
   314    314   ccons ::= DEFAULT scanpt id(X).       {
   315    315     Expr *p = tokenExpr(pParse, TK_STRING, X);
   316         -  sqlite3ExprIdToTrueFalse(p);
   317         -  testcase( p->op==TK_TRUEFALSE && sqlite3ExprTruthValue(p) );
          316  +  if( p ){
          317  +    sqlite3ExprIdToTrueFalse(p);
          318  +    testcase( p->op==TK_TRUEFALSE && sqlite3ExprTruthValue(p) );
          319  +  }
   318    320     sqlite3AddDefaultValue(pParse,p,X.z,X.z+X.n);
   319    321   }
   320    322   
   321    323   // In addition to the type name, we also care about the primary key and
   322    324   // UNIQUE constraints.
   323    325   //
   324    326   ccons ::= NULL onconf.