/ Check-in [7e38305e]
Login

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

Overview
Comment:Enhance TreeView so that it can display the new IS TRUE expression trees.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | is-true-operator
Files: files | file ages | folders
SHA3-256:7e38305e6f71c3353df3d11d099e255eefbacceafd7ed2ccaba257fe2e7b8c38
User & Date: drh 2018-02-26 19:03:25
Context
2018-02-26
20:15
Get the "DEFAULT true" and "DEFAULT false" phrases working correctly in CREATE TABLE. check-in: 8002f87d user: drh tags: is-true-operator
19:03
Enhance TreeView so that it can display the new IS TRUE expression trees. check-in: 7e38305e user: drh tags: is-true-operator
18:49
Refactor for correct NULL handling in the IS TRUE, IS FALSE, IS NOT TRUE, and IS NOT FALSE operators. check-in: cf2abd59 user: drh tags: is-true-operator
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/treeview.c.

   287    287       case TK_STRING: {
   288    288         sqlite3TreeViewLine(pView,"%Q", pExpr->u.zToken);
   289    289         break;
   290    290       }
   291    291       case TK_NULL: {
   292    292         sqlite3TreeViewLine(pView,"NULL");
   293    293         break;
          294  +    }
          295  +    case TK_TRUEFALSE: {
          296  +      sqlite3TreeViewLine(pView, pExpr->iTable ? "TRUE":"FALSE");
          297  +      break;
   294    298       }
   295    299   #ifndef SQLITE_OMIT_BLOB_LITERAL
   296    300       case TK_BLOB: {
   297    301         sqlite3TreeViewLine(pView,"%s", pExpr->u.zToken);
   298    302         break;
   299    303       }
   300    304   #endif
................................................................................
   343    347   
   344    348       case TK_UMINUS:  zUniOp = "UMINUS"; break;
   345    349       case TK_UPLUS:   zUniOp = "UPLUS";  break;
   346    350       case TK_BITNOT:  zUniOp = "BITNOT"; break;
   347    351       case TK_NOT:     zUniOp = "NOT";    break;
   348    352       case TK_ISNULL:  zUniOp = "ISNULL"; break;
   349    353       case TK_NOTNULL: zUniOp = "NOTNULL"; break;
          354  +
          355  +    case TK_TRUTH: {
          356  +      assert( pExpr->op2==TK_IS || pExpr->op2==TK_ISNOT );
          357  +      assert( pExpr->pRight );
          358  +      assert( pExpr->pRight->op==TK_TRUEFALSE );
          359  +      assert( pExpr->pRight->iTable==0 || pExpr->pRight->iTable==1 );
          360  +      switch( (pExpr->op2==TK_ISNOT)*2 + pExpr->pRight->iTable ){
          361  +        case 0: zUniOp = "IS-FALSE";     break;
          362  +        case 1: zUniOp = "IS-TRUE";      break;
          363  +        case 2: zUniOp = "IS-NOT-FALSE"; break;
          364  +        case 3: zUniOp = "IS-NOT-TRUE";  break;
          365  +      }
          366  +      break;
          367  +    }
   350    368   
   351    369       case TK_SPAN: {
   352    370         sqlite3TreeViewLine(pView, "SPAN %Q", pExpr->u.zToken);
   353    371         sqlite3TreeViewExpr(pView, pExpr->pLeft, 0);
   354    372         break;
   355    373       }
   356    374