/ Check-in [48775ec6]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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 Unified Diffs Ignore Whitespace Patch

Changes to src/parse.y.

309
310
311
312
313
314
315

316
317

318
319
320
321
322
323
324
                            {sqlite3AddDefaultValue(pParse,X,A.z,Z);}
ccons ::= DEFAULT MINUS(A) term(X) scanpt(Z).      {
  Expr *p = sqlite3PExpr(pParse, TK_UMINUS, X, 0);
  sqlite3AddDefaultValue(pParse,p,A.z,Z);
}
ccons ::= DEFAULT scanpt id(X).       {
  Expr *p = tokenExpr(pParse, TK_STRING, X);

  sqlite3ExprIdToTrueFalse(p);
  testcase( p->op==TK_TRUEFALSE && sqlite3ExprTruthValue(p) );

  sqlite3AddDefaultValue(pParse,p,X.z,X.z+X.n);
}

// In addition to the type name, we also care about the primary key and
// UNIQUE constraints.
//
ccons ::= NULL onconf.







>
|
|
>







309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
                            {sqlite3AddDefaultValue(pParse,X,A.z,Z);}
ccons ::= DEFAULT MINUS(A) term(X) scanpt(Z).      {
  Expr *p = sqlite3PExpr(pParse, TK_UMINUS, X, 0);
  sqlite3AddDefaultValue(pParse,p,A.z,Z);
}
ccons ::= DEFAULT scanpt id(X).       {
  Expr *p = tokenExpr(pParse, TK_STRING, X);
  if( p ){
    sqlite3ExprIdToTrueFalse(p);
    testcase( p->op==TK_TRUEFALSE && sqlite3ExprTruthValue(p) );
  }
  sqlite3AddDefaultValue(pParse,p,X.z,X.z+X.n);
}

// In addition to the type name, we also care about the primary key and
// UNIQUE constraints.
//
ccons ::= NULL onconf.