Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Merge ALTER TABLE and sqlite3_normalized_sql() fixes from trunk. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | begin-concurrent |
Files: | files | file ages | folders |
SHA3-256: |
acf10b3f8d6675ddf787f7db55a9ff0e |
User & Date: | drh 2018-12-06 00:05:18.923 |
Context
2018-12-06
| ||
02:08 | Merge bug fixes from trunk. (check-in: 1e13aaa29f user: drh tags: begin-concurrent) | |
00:08 | Merge ALTER TABLE and sqlite3_normalized_sql() bug fixes from trunk. (check-in: 3793e5d5d6 user: drh tags: begin-concurrent-pnu) | |
00:05 | Merge ALTER TABLE and sqlite3_normalized_sql() fixes from trunk. (check-in: acf10b3f8d user: drh tags: begin-concurrent) | |
2018-12-05
| ||
23:56 | Get rid of the hash table used to track IN operators in the sqlite3_normalized_sql() implementation. Use simple integer variables instead. (check-in: 272dc74fd0 user: drh tags: trunk) | |
13:44 | Merge enhancements from trunk, especially the enhanced sqlite3_normalized_sql() interface. (check-in: 47b73f6bfe user: drh tags: begin-concurrent) | |
Changes
Changes to VERSION.
| 1 | - + |
|
Changes to configure.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | #! /bin/sh # Guess values for system-dependent variables and create Makefiles. |
︙ | |||
722 723 724 725 726 727 728 | 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 | - - + + | subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' |
︙ | |||
1462 1463 1464 1465 1466 1467 1468 | 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 | - + | # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF |
︙ | |||
1527 1528 1529 1530 1531 1532 1533 | 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 | - + | --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in |
︙ | |||
1653 1654 1655 1656 1657 1658 1659 | 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 | - + | cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF |
︙ | |||
2072 2073 2074 2075 2076 2077 2078 | 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 | - + | eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. |
︙ | |||
12228 12229 12230 12231 12232 12233 12234 | 12228 12229 12230 12231 12232 12233 12234 12235 12236 12237 12238 12239 12240 12241 12242 | - + | test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" |
︙ | |||
12294 12295 12296 12297 12298 12299 12300 | 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 | - + | Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ |
︙ |
Changes to src/alter.c.
︙ | |||
775 776 777 778 779 780 781 782 783 784 785 786 787 788 | 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 | + + + + + + + + + + + + + + + + + + - + - | pToken->pNext = pCtx->pList; pCtx->pList = pToken; pCtx->nList++; break; } } } /* ** Iterate through the Select objects that are part of WITH clauses attached ** to select statement pSelect. */ static void renameWalkWith(Walker *pWalker, Select *pSelect){ if( pSelect->pWith ){ int i; for(i=0; i<pSelect->pWith->nCte; i++){ Select *p = pSelect->pWith->a[i].pSelect; NameContext sNC; memset(&sNC, 0, sizeof(sNC)); sNC.pParse = pWalker->pParse; sqlite3SelectPrep(sNC.pParse, p, &sNC); sqlite3WalkSelect(pWalker, p); } } } /* ** This is a Walker select callback. It does nothing. It is only required ** because without a dummy callback, sqlite3WalkExpr() and similar do not ** descend into sub-select statements. */ static int renameColumnSelectCb(Walker *pWalker, Select *p){ |
︙ | |||
1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 | 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 | + | SrcList *pSrc = pSelect->pSrc; for(i=0; i<pSrc->nSrc; i++){ struct SrcList_item *pItem = &pSrc->a[i]; if( pItem->pTab==p->pTab ){ renameTokenFind(pWalker->pParse, p, pItem->zName); } } renameWalkWith(pWalker, pSelect); return WRC_Continue; } /* ** This C function implements an SQL user function that is used by SQL code |
︙ |
Changes to src/callback.c.
︙ | |||
279 280 281 282 283 284 285 | 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | - + - - - - - - - - - - - - - - - - + | return match; } /* ** Search a FuncDefHash for a function with the given name. Return ** a pointer to the matching FuncDef if found, or 0 if there is no match. */ |
︙ | |||
399 400 401 402 403 404 405 | 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 | - + | ** have fields overwritten with new information appropriate for the ** new function. But the FuncDefs for built-in functions are read-only. ** So we must not search for built-ins when creating a new function. */ if( !createFlag && (pBest==0 || (db->mDbFlags & DBFLAG_PreferBuiltin)!=0) ){ bestScore = 0; h = SQLITE_FUNC_HASH(sqlite3UpperToLower[(u8)zName[0]], nName); |
︙ |
Changes to src/expr.c.
︙ | |||
2145 2146 2147 2148 2149 2150 2151 | 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 | - - - - - - - - | */ int sqlite3IsRowid(const char *z){ if( sqlite3StrICmp(z, "_ROWID_")==0 ) return 1; if( sqlite3StrICmp(z, "ROWID")==0 ) return 1; if( sqlite3StrICmp(z, "OID")==0 ) return 1; return 0; } |
︙ |
Changes to src/hash.c.
︙ | |||
60 61 62 63 64 65 66 | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | - - - - - - - - - - - - - - | ** 0x9e3779b1 is 2654435761 which is the closest prime number to ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */ h += sqlite3UpperToLower[c]; h *= 0x9e3779b1; } return h; } |
︙ | |||
185 186 187 188 189 190 191 | 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | if( sqlite3StrICmp(elem->pKey,pKey)==0 ){ return elem; } elem = elem->next; } return &nullElement; } |
︙ | |||
263 264 265 266 267 268 269 | 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | - - - - - - - - | ** found, or NULL if there is no match. */ void *sqlite3HashFind(const Hash *pH, const char *pKey){ assert( pH!=0 ); assert( pKey!=0 ); return findElementWithHash(pH, pKey, 0)->data; } |
︙ |
Changes to src/hash.h.
︙ | |||
64 65 66 67 68 69 70 | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | - - - | /* ** Access routines. To delete, insert a NULL pointer. */ void sqlite3HashInit(Hash*); void *sqlite3HashInsert(Hash*, const char *pKey, void *pData); void *sqlite3HashFind(const Hash*, const char *pKey); |
︙ |
Changes to src/prepare.c.
︙ | |||
706 707 708 709 710 711 712 | 706 707 708 709 710 711 712 713 714 715 716 717 718 719 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | rc = sqlite3ApiExit(db, rc); assert( (rc&db->errMask)==rc ); sqlite3_mutex_leave(db->mutex); return rc; } #ifdef SQLITE_ENABLE_NORMALIZE |
︙ | |||
860 861 862 863 864 865 866 | 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 | - + + - | int nZ; /* Size of the output string in bytes */ int i; /* Next character to read from zSql[] */ int j; /* Next character to fill in on z[] */ int tokenType = 0; /* Type of the next token */ int prevTokenType = 0; /* Type of the previous token, except spaces */ int n; /* Size of the next token */ int nParen = 0; /* Nesting level of parenthesis */ |
︙ | |||
893 894 895 896 897 898 899 | 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 | + - + - - - + - - - - - - + + + + | break; } case TK_LP: case TK_RP: { if( tokenType==TK_LP ){ nParen++; if( prevTokenType==TK_IN ){ iStartIN = j; |
︙ | |||
952 953 954 955 956 957 958 | 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 | - - + + - - - - - - - - - - - - | break; } } if( j>0 && sqlite3IsIdChar(z[j-1]) && sqlite3IsIdChar(zSql[i]) ){ z[j++] = ' '; } if( tokenType==TK_ID ){ |
︙ |
Changes to src/sqliteInt.h.
︙ | |||
4024 4025 4026 4027 4028 4029 4030 | 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 | - - - | #ifdef SQLITE_ENABLE_CURSOR_HINTS int sqlite3ExprContainsSubquery(Expr*); #endif int sqlite3ExprIsInteger(Expr*, int*); int sqlite3ExprCanBeNull(const Expr*); int sqlite3ExprNeedsNoAffinityChange(const Expr*, char); int sqlite3IsRowid(const char*); |
︙ | |||
4053 4054 4055 4056 4057 4058 4059 | 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 | - - + - | void sqlite3UniqueConstraint(Parse*, int, Index*); void sqlite3RowidConstraint(Parse*, int, Table*); Expr *sqlite3ExprDup(sqlite3*,Expr*,int); ExprList *sqlite3ExprListDup(sqlite3*,ExprList*,int); SrcList *sqlite3SrcListDup(sqlite3*,SrcList*,int); IdList *sqlite3IdListDup(sqlite3*,IdList*); Select *sqlite3SelectDup(sqlite3*,Select*,int); |
︙ |
Changes to test/altertab2.test.
︙ | |||
8 9 10 11 12 13 14 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | - + | # May you share freely, never taking more than you give. # #************************************************************************* # set testdir [file dirname $argv0] source $testdir/tester.tcl |
︙ | |||
81 82 83 84 85 86 87 | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | SELECT sql FROM sqlite_master WHERE name LIKE 'c%'; } { {CREATE TABLE c1(x REFERENCES "p3")} {CREATE TABLE c2(x, FOREIGN KEY (x) REFERENCES "p3")} {CREATE TABLE c3(x, FOREIGN KEY (x) REFERENCES "p3"(a))} } #------------------------------------------------------------------------- # Table name in WITH clauses that are part of views or triggers. |
Changes to test/normalize.test.
︙ | |||
82 83 84 85 86 87 88 | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | - + | set STMT [sqlite3_prepare_v3 $DB \ "SELECT a, b FROM t1 WHERE b = ? ORDER BY a;" -1 0 TAIL] sqlite3_bind_null $STMT 1 } {} do_test 202 { sqlite3_normalized_sql $STMT |
︙ | |||
203 204 205 206 207 208 209 | 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | - + | {SELECT a FROM t1 WHERE x IN (1,2,3) AND hex8('abc');} 0x2 {0 {SELECT a FROM t1 WHERE x IN(?,?,?)AND hex8(?);}} 430 {SELECT "a" FROM t1 WHERE "x" IN ("1","2",'3');} 0x2 |
︙ |