/ Check-in [81f25d5c]
Login

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

Overview
Comment:Add assert() statements to sqlite3ExprDelete() that prove various symmetry properties of the Expr object that might be exploited to make the Expr object smaller and faster.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | expr-simplify
Files: files | file ages | folders
SHA3-256:81f25d5c84e4d2d0cd3c6a7c105c7c93d310218feeea4e023dbc32e7e96b2a52
User & Date: drh 2018-07-28 01:30:43
Context
2018-09-18
18:08
Merge all recent trunk enhancements. check-in: 655f0654 user: drh tags: expr-simplify
2018-07-28
13:37
An early attempt at refactoring Expr Closed-Leaf check-in: fc90a53d user: drh tags: expr-simplify-branch1
01:30
Add assert() statements to sqlite3ExprDelete() that prove various symmetry properties of the Expr object that might be exploited to make the Expr object smaller and faster. check-in: 81f25d5c user: drh tags: expr-simplify
2018-07-27
23:33
Improvements to the parser to increase coverage. Fix the parser so that at least one expresssion is required after PARTITION BY and within the list of expressions on VALUES(). check-in: 02204f8b user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

  1056   1056     assert( !ExprHasProperty(p, EP_IntValue) || p->u.iValue>=0 );
  1057   1057   #ifdef SQLITE_DEBUG
  1058   1058     if( ExprHasProperty(p, EP_Leaf) && !ExprHasProperty(p, EP_TokenOnly) ){
  1059   1059       assert( p->pLeft==0 );
  1060   1060       assert( p->pRight==0 );
  1061   1061       assert( p->x.pSelect==0 );
  1062   1062     }
         1063  +  if( !ExprHasProperty(p, EP_TokenOnly) ){
         1064  +    assert( p->op!=TK_FUNCTION || p->pLeft==0 );
         1065  +    assert( p->pRight==0 || p->x.pSelect==0 );
         1066  +  }
         1067  +  if( !ExprHasProperty(p, (EP_TokenOnly|EP_Reduced)) ){
         1068  +    assert( p->pWin==0 || p->pLeft==0 );
         1069  +    assert( p->pWin==0 || p->pTab==0 );
         1070  +    assert( p->pWin==0 || p->op==TK_FUNCTION );
         1071  +    assert( p->pWin==0 || !ExprHasProperty(p, EP_xIsSelect) );
         1072  +    assert( p->pTab==0 || (p->pRight==0 && p->x.pSelect==0) );
         1073  +  }
  1063   1074   #endif
  1064   1075     if( !ExprHasProperty(p, (EP_TokenOnly|EP_Leaf)) ){
  1065   1076       /* The Expr.x union is never used at the same time as Expr.pRight */
  1066   1077       assert( p->x.pList==0 || p->pRight==0 );
  1067   1078       if( p->pLeft && p->op!=TK_SELECT_COLUMN ) sqlite3ExprDeleteNN(db, p->pLeft);
  1068   1079       if( p->pRight ){
  1069   1080         sqlite3ExprDeleteNN(db, p->pRight);