Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Clean up comments and variable names prior to merge. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | is-true-operator |
Files: | files | file ages | folders |
SHA3-256: |
6445519e91c4f98b4a9a45d5091d733c |
User & Date: | drh 2018-02-27 14:49:25.328 |
Context
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: 9a7f02c50e user: drh tags: trunk) | |
14:49 | Clean up comments and variable names prior to merge. (Closed-Leaf check-in: 6445519e91 user: drh tags: is-true-operator) | |
00:58 | Remove an unnecessary decision. (check-in: adcb466549 user: drh tags: is-true-operator) | |
Changes
Changes to src/expr.c.
︙ | |||
1730 1731 1732 1733 1734 1735 1736 | 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 | - - + + - + - + | UNUSED_PARAMETER(NotUsed); pWalker->eCode = 0; return WRC_Abort; } /* ** If the input expression is an ID with the name "true" or "false" |
︙ | |||
3574 3575 3576 3577 3578 3579 3580 | 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 | - + | pExpr->op2); } case TK_INTEGER: { codeInteger(pParse, pExpr, 0, target); return target; } case TK_TRUEFALSE: { |
︙ | |||
3733 3734 3735 3736 3737 3738 3739 | 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 | - + + - - + + + + + - | assert( TK_NOT==OP_Not ); testcase( op==TK_NOT ); r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1); testcase( regFree1==0 ); sqlite3VdbeAddOp2(v, op, r1, inReg); break; } case TK_TRUTH: { |
︙ | |||
4517 4518 4519 4520 4521 4522 4523 | 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 | - - + + - + - + | } case TK_NOT: { testcase( jumpIfNull==0 ); sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest, jumpIfNull); break; } case TK_TRUTH: { |
︙ | |||
4688 4689 4690 4691 4692 4693 4694 | 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 | - - + + - - + - + - + | } case TK_NOT: { testcase( jumpIfNull==0 ); sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest, jumpIfNull); break; } case TK_TRUTH: { |
︙ |
Changes to src/parse.y.
︙ | |||
310 311 312 313 314 315 316 | 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | - + | 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); |
︙ |
Changes to src/sqliteInt.h.
︙ | |||
3836 3837 3838 3839 3840 3841 3842 | 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 | - + | void sqlite3CodeVerifyNamedSchema(Parse*, const char *zDb); void sqlite3BeginTransaction(Parse*, int); void sqlite3EndTransaction(Parse*,int); void sqlite3Savepoint(Parse*, int, Token*); void sqlite3CloseSavepoints(sqlite3 *); void sqlite3LeaveMutexAndCloseZombie(sqlite3*); int sqlite3ExprIdToTrueFalse(Expr*); |
︙ |
Changes to src/treeview.c.
︙ | |||
290 291 292 293 294 295 296 | 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | - + | } case TK_NULL: { sqlite3TreeViewLine(pView,"NULL"); break; } case TK_TRUEFALSE: { sqlite3TreeViewLine(pView, |
︙ | |||
357 358 359 360 361 362 363 | 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 | - + | int x; const char *azOp[] = { "IS-FALSE", "IS-TRUE", "IS-NOT-FALSE", "IS-NOT-TRUE" }; assert( pExpr->op2==TK_IS || pExpr->op2==TK_ISNOT ); assert( pExpr->pRight ); assert( pExpr->pRight->op==TK_TRUEFALSE ); |
︙ |
Changes to src/vdbe.c.
︙ | |||
2193 2194 2195 2196 2197 2198 2199 | 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 | - + - - - - + + + + + | /* Opcode: IsTrue P1 P2 P3 P4 * ** Synopsis: r[P2] = coalesce(r[P1]==TRUE,P3) ^ P4 ** ** This opcode implements the IS TRUE, IS FALSE, IS NOT TRUE, and ** IS NOT FALSE operators. ** |
︙ |