Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Import all the latest trunk changes into the sessions branch. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | sessions |
Files: | files | file ages | folders |
SHA1: |
87a0eab5d98fff93aa2147c04c4af27b |
User & Date: | drh 2012-04-18 01:41:37.755 |
Context
2012-04-19
| ||
20:00 | Merge the latest trunk changes into the sessions branch. (check-in: 2b7a91e617 user: drh tags: sessions) | |
2012-04-18
| ||
01:41 | Import all the latest trunk changes into the sessions branch. (check-in: 87a0eab5d9 user: drh tags: sessions) | |
2012-04-17
| ||
16:38 | Improved handling of aggregate subqueries within an aggregate query. (check-in: 430bb59d79 user: drh tags: trunk) | |
2012-03-30
| ||
17:30 | Merge all recent trunk changes into the sessions branch. (check-in: fb9b9987de user: drh tags: sessions) | |
Changes
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. |
︙ | |||
739 740 741 742 743 744 745 | 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 | - - + + | MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' |
︙ | |||
1481 1482 1483 1484 1485 1486 1487 | 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 | - + | # # 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 |
︙ | |||
1546 1547 1548 1549 1550 1551 1552 | 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 | - + | --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 |
︙ | |||
1662 1663 1664 1665 1666 1667 1668 | 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 | - + - + | cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF |
︙ | |||
14028 14029 14030 14031 14032 14033 14034 | 14028 14029 14030 14031 14032 14033 14034 14035 14036 14037 14038 14039 14040 14041 14042 | - + | exec 6>&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=" |
︙ | |||
14081 14082 14083 14084 14085 14086 14087 | 14081 14082 14083 14084 14085 14086 14087 14088 14089 14090 14091 14092 14093 14094 14095 | - + | $config_commands Report bugs to <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ |
︙ |
Changes to ext/fts3/fts3_icu.c.
︙ | |||
106 107 108 109 110 111 112 | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | + + + - + | UChar32 c; int iInput = 0; int iOut = 0; *ppCursor = 0; if( zInput==0 ){ nInput = 0; zInput = ""; |
︙ |
Changes to ext/fts3/fts3_test.c.
︙ | |||
18 19 20 21 22 23 24 | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | - + + | ** that the sqlite3_tokenizer_module.xLanguage() method is invoked correctly. */ #include <tcl.h> #include <string.h> #include <assert.h> |
︙ | |||
526 527 528 529 530 531 532 533 | 527 528 529 530 531 532 533 534 535 | + | "fts3_configure_incr_load", fts3_configure_incr_load_cmd, 0, 0 ); Tcl_CreateObjCommand( interp, "fts3_test_tokenizer", fts3_test_tokenizer_cmd, 0, 0 ); return TCL_OK; } #endif /* SQLITE_ENABLE_FTS3 || SQLITE_ENABLE_FTS4 */ #endif /* ifdef SQLITE_TEST */ |
Changes to ext/fts3/fts3_write.c.
︙ | |||
3735 3736 3737 3738 3739 3740 3741 | 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 | - | } /* Advance to the next output block */ pLeaf->iBlock++; pLeaf->key.n = 0; pLeaf->block.n = 0; |
︙ |
Changes to ext/rtree/rtree.c.
︙ | |||
178 179 180 181 182 183 184 185 186 187 188 189 190 191 | 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | + + + + + + + + + + + + + | int eCoordType; }; /* Possible values for eCoordType: */ #define RTREE_COORD_REAL32 0 #define RTREE_COORD_INT32 1 /* ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will ** only deal with integer coordinates. No floating point operations ** will be done. */ #ifdef SQLITE_RTREE_INT_ONLY typedef sqlite3_int64 RtreeDValue; /* High accuracy coordinate */ typedef int RtreeValue; /* Low accuracy coordinate */ #else typedef double RtreeDValue; /* High accuracy coordinate */ typedef float RtreeValue; /* Low accuracy coordinate */ #endif /* ** The minimum number of cells allowed for a node is a third of the ** maximum. In Gutman's notation: ** ** m = M/3 ** ** If an R*-tree "Reinsert" operation is required, the same number of |
︙ | |||
213 214 215 216 217 218 219 | 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | - + - - + + + + + + - - - - - + + + + + + - - + + | int iCell; /* Index of current cell in pNode */ int iStrategy; /* Copy of idxNum search parameter */ int nConstraint; /* Number of entries in aConstraint */ RtreeConstraint *aConstraint; /* Search constraints. */ }; union RtreeCoord { |
︙ | |||
283 284 285 286 287 288 289 | 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 | - + - + - + | /* ** An instance of this structure must be supplied as a blob argument to ** the right-hand-side of an SQL MATCH operator used to constrain an ** r-tree query. */ struct RtreeMatchArg { u32 magic; /* Always RTREE_GEOMETRY_MAGIC */ |
︙ | |||
864 865 866 867 868 869 870 | 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | - + | static int testRtreeGeom( Rtree *pRtree, /* R-Tree object */ RtreeConstraint *pConstraint, /* MATCH constraint to test */ RtreeCell *pCell, /* Cell to test */ int *pbRes /* OUT: Test result */ ){ int i; |
︙ | |||
894 895 896 897 898 899 900 | 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 | - - + + | int ii; int bRes = 0; int rc = SQLITE_OK; nodeGetCell(pRtree, pCursor->pNode, pCursor->iCell, &cell); for(ii=0; bRes==0 && ii<pCursor->nConstraint; ii++){ RtreeConstraint *p = &pCursor->aConstraint[ii]; |
︙ | |||
947 948 949 950 951 952 953 | 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 | - + | RtreeCell cell; int ii; *pbEof = 0; nodeGetCell(pRtree, pCursor->pNode, pCursor->iCell, &cell); for(ii=0; ii<pCursor->nConstraint; ii++){ RtreeConstraint *p = &pCursor->aConstraint[ii]; |
︙ | |||
1145 1146 1147 1148 1149 1150 1151 1152 1153 | 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 | + - + + + | if( i==0 ){ i64 iRowid = nodeGetRowid(pRtree, pCsr->pNode, pCsr->iCell); sqlite3_result_int64(ctx, iRowid); }else{ RtreeCoord c; nodeGetCoord(pRtree, pCsr->pNode, pCsr->iCell, i-1, &c); #ifndef SQLITE_RTREE_INT_ONLY if( pRtree->eCoordType==RTREE_COORD_REAL32 ){ sqlite3_result_double(ctx, c.f); |
︙ | |||
1194 1195 1196 1197 1198 1199 1200 | 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 | - + - + | /* Check that value is actually a blob. */ if( sqlite3_value_type(pValue)!=SQLITE_BLOB ) return SQLITE_ERROR; /* Check that the blob is roughly the right size. */ nBlob = sqlite3_value_bytes(pValue); if( nBlob<(int)sizeof(RtreeMatchArg) |
︙ | |||
1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 | 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 | + + + + | ** an sqlite3_rtree_geometry_callback() SQL user function. */ rc = deserializeGeometry(argv[ii], p); if( rc!=SQLITE_OK ){ break; } }else{ #ifdef SQLITE_RTREE_INT_ONLY p->rValue = sqlite3_value_int64(argv[ii]); #else p->rValue = sqlite3_value_double(argv[ii]); #endif } } } } if( rc==SQLITE_OK ){ pCsr->pNode = 0; |
︙ | |||
1414 1415 1416 1417 1418 1419 1420 | 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 | - - + + - + - - + + - + | pIdxInfo->estimatedCost = (2000000.0 / (double)(iIdx + 1)); return rc; } /* ** Return the N-dimensional volumn of the cell stored in *p. */ |
︙ | |||
1476 1477 1478 1479 1480 1481 1482 | 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 | - - + + - + - + - + - + - - + - + - + - - + | } return 1; } /* ** Return the amount cell p would grow by if it were unioned with pCell. */ |
︙ | |||
1564 1565 1566 1567 1568 1569 1570 | 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 | - - + + - - + + | RtreeNode *pNode; rc = nodeAcquire(pRtree, 1, 0, &pNode); for(ii=0; rc==SQLITE_OK && ii<(pRtree->iDepth-iHeight); ii++){ int iCell; sqlite3_int64 iBest = 0; |
︙ | |||
1599 1600 1601 1602 1603 1604 1605 | 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 | - - + + | /* Select the child node which will be enlarged the least if pCell ** is inserted into it. Resolve ties by choosing the entry with ** the smallest area. */ for(iCell=0; iCell<nCell; iCell++){ int bBest = 0; |
︙ | |||
1727 1728 1729 1730 1731 1732 1733 | 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 | - + - - - - + + + + - - + + - + | int nCell, int *piLeftSeed, int *piRightSeed ){ int i; int iLeftSeed = 0; int iRightSeed = 1; |
︙ | |||
1790 1791 1792 1793 1794 1795 1796 | 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 | - + - - - + + + | RtreeCell *pLeftBox, RtreeCell *pRightBox, int *aiUsed ){ #define FABS(a) ((a)<0.0?-1.0*(a):(a)) int iSelect = -1; |
︙ | |||
1823 1824 1825 1826 1827 1828 1829 | 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 | - + - - - + + + | int *piRightSeed ){ int ii; int jj; int iLeftSeed = 0; int iRightSeed = 1; |
︙ | |||
1864 1865 1866 1867 1868 1869 1870 | 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 | - + | ** ** The aSpare array is used as temporary working space by the ** sorting algorithm. */ static void SortByDistance( int *aIdx, int nIdx, |
︙ | |||
1890 1891 1892 1893 1894 1895 1896 | 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 | - - + + - - + + | if( iLeft==nLeft ){ aIdx[iLeft+iRight] = aRight[iRight]; iRight++; }else if( iRight==nRight ){ aIdx[iLeft+iRight] = aLeft[iLeft]; iLeft++; }else{ |
︙ | |||
1951 1952 1953 1954 1955 1956 1957 | 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 | - - - - + + + + - - - - + + + + | SortByDimension(pRtree, aLeft, nLeft, iDim, aCell, aSpare); SortByDimension(pRtree, aRight, nRight, iDim, aCell, aSpare); memcpy(aSpare, aLeft, sizeof(int)*nLeft); aLeft = aSpare; while( iLeft<nLeft || iRight<nRight ){ |
︙ | |||
2002 2003 2004 2005 2006 2007 2008 | 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 | - + - - - + + + - - + + | ){ int **aaSorted; int *aSpare; int ii; int iBestDim = 0; int iBestSplit = 0; |
︙ | |||
2121 2122 2123 2124 2125 2126 2127 | 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 | - + | nodeInsertCell(pRtree, pRight, &aCell[iRightSeed]); aiUsed[iLeftSeed] = 1; aiUsed[iRightSeed] = 1; for(i=nCell-2; i>0; i--){ RtreeCell *pNext; pNext = PickNext(pRtree, aCell, nCell, pBboxLeft, pBboxRight, aiUsed); |
︙ | |||
2454 2455 2456 2457 2458 2459 2460 | 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 | - + - + + - + + - - - - - + + + + + - - - + + + - - + + - + - - + + | RtreeNode *pNode, RtreeCell *pCell, int iHeight ){ int *aOrder; int *aSpare; RtreeCell *aCell; |
︙ | |||
2743 2744 2745 2746 2747 2748 2749 2750 2751 | 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 | + - - + + - + + + | ** conflict-handling mode specified by the user. */ if( nData>1 ){ int ii; /* Populate the cell.aCoord[] array. The first coordinate is azData[3]. */ assert( nData==(pRtree->nDim*2 + 3) ); #ifndef SQLITE_RTREE_INT_ONLY if( pRtree->eCoordType==RTREE_COORD_REAL32 ){ for(ii=0; ii<(pRtree->nDim*2); ii+=2){ |
︙ | |||
3150 3151 3152 3153 3154 3155 3156 | 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 | + - + + + + + + | RtreeCell cell; int jj; nodeGetCell(&tree, &node, ii, &cell); sqlite3_snprintf(512-nCell,&zCell[nCell],"%lld", cell.iRowid); nCell = (int)strlen(zCell); for(jj=0; jj<tree.nDim*2; jj++){ #ifndef SQLITE_RTREE_INT_ONLY |
︙ | |||
3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 | 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 | + + + + | int rc; rc = sqlite3_create_function(db, "rtreenode", 2, utf8, 0, rtreenode, 0, 0); if( rc==SQLITE_OK ){ rc = sqlite3_create_function(db, "rtreedepth", 1, utf8, 0,rtreedepth, 0, 0); } if( rc==SQLITE_OK ){ #ifdef SQLITE_RTREE_INT_ONLY void *c = (void *)RTREE_COORD_INT32; #else void *c = (void *)RTREE_COORD_REAL32; #endif rc = sqlite3_create_module_v2(db, "rtree", &rtreeModule, c, 0); } if( rc==SQLITE_OK ){ void *c = (void *)RTREE_COORD_INT32; rc = sqlite3_create_module_v2(db, "rtree_i32", &rtreeModule, c, 0); } |
︙ | |||
3226 3227 3228 3229 3230 3231 3232 | 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 | - + + + + + - + | ** table MATCH operators. */ static void geomCallback(sqlite3_context *ctx, int nArg, sqlite3_value **aArg){ RtreeGeomCallback *pGeomCtx = (RtreeGeomCallback *)sqlite3_user_data(ctx); RtreeMatchArg *pBlob; int nBlob; |
︙ |
Changes to ext/rtree/rtree1.test.
︙ | |||
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | 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 146 147 148 149 150 151 152 153 154 | + + + + + + + + + + + + - - + + - + - + | catchsql " CREATE VIRTUAL TABLE t1 USING rtree($columns); " } $X catchsql { DROP TABLE t1 } } # Like execsql except display output as integer where that can be # done without loss of information. # proc execsql_intout {sql} { set out {} foreach term [execsql $sql] { regsub {\.0$} $term {} term lappend out $term } return $out } # Test that it is possible to open an existing database that contains # r-tree tables. # do_test rtree-1.4.1 { execsql { CREATE VIRTUAL TABLE t1 USING rtree(ii, x1, x2); INSERT INTO t1 VALUES(1, 5.0, 10.0); INSERT INTO t1 VALUES(2, 15.0, 20.0); } } {} do_test rtree-1.4.2 { db close sqlite3 db test.db |
︙ | |||
157 158 159 160 161 162 163 | 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | - - + + | CREATE VIRTUAL TABLE t1 USING rtree(ii, x1, x2, y1, y2); SELECT * FROM t1; } } {} do_test rtree-2.1.2 { execsql { INSERT INTO t1 VALUES(NULL, 1, 3, 2, 4) } |
︙ | |||
197 198 199 200 201 202 203 | 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 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 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 | - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + | do_test rtree-3.1.1 { execsql { CREATE VIRTUAL TABLE t1 USING rtree(ii, x1, x2, y1, y2); SELECT * FROM t1; } } {} do_test rtree-3.1.2 { |
︙ |
Changes to ext/rtree/rtree4.test.
︙ | |||
23 24 25 26 27 28 29 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | } set ::NROW 2500 if {[info exists G(isquick)] && $G(isquick)} { set ::NROW 250 } ifcapable !rtree_int_only { |
︙ |
Changes to ext/rtree/rtree5.test.
︙ | |||
45 46 47 48 49 50 51 | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | + - - - + + + + | do_test rtree5-1.6 { execsql { SELECT x1==5.0 FROM t1 } } {1} do_test rtree5-1.7 { execsql { SELECT count(*) FROM t1 WHERE x1==5 } } {1} ifcapable !rtree_int_only { |
︙ |
Changes to ext/rtree/rtree6.test.
︙ | |||
12 13 14 15 16 17 18 | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | - + | # if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] } source $testdir/tester.tcl |
︙ |
Changes to ext/rtree/rtree7.test.
︙ | |||
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | + + + + + + + + + + + + - - + + - + - + - - + + - + - + | } source $testdir/tester.tcl ifcapable !rtree||!vacuum { finish_test return } # Like execsql except display output as integer where that can be # done without loss of information. # proc execsql_intout {sql} { set out {} foreach term [execsql $sql] { regsub {\.0$} $term {} term lappend out $term } return $out } do_test rtree7-1.1 { execsql { PRAGMA page_size = 1024; CREATE VIRTUAL TABLE rt USING rtree(id, x1, x2, y1, y2); INSERT INTO rt VALUES(1, 1, 2, 3, 4); } } {} do_test rtree7-1.2 { |
Changes to ext/rtree/rtree9.test.
︙ | |||
13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | + | # if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] } source $testdir/tester.tcl ifcapable !rtree { finish_test ; return } ifcapable rtree_int_only { finish_test; return } register_cube_geom db do_execsql_test rtree9-1.1 { CREATE VIRTUAL TABLE rt USING rtree(id, x1, x2, y1, y2, z1, z2); INSERT INTO rt VALUES(1, 1, 2, 1, 2, 1, 2); } {} |
︙ |
Changes to ext/rtree/rtreeB.test.
︙ | |||
14 15 16 17 18 19 20 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + | if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] } source $testdir/tester.tcl ifcapable !rtree { finish_test ; return } ifcapable rtree_int_only { do_test rtreeB-1.1-intonly { db eval { CREATE VIRTUAL TABLE t1 USING rtree(ii, x0, y0, x1, y1); INSERT INTO t1 VALUES(1073741824, 0.0, 0.0, 100.0, 100.0); INSERT INTO t1 VALUES(2147483646, 0.0, 0.0, 200.0, 200.0); INSERT INTO t1 VALUES(4294967296, 0.0, 0.0, 300.0, 300.0); INSERT INTO t1 VALUES(8589934592, 20.0, 20.0, 150.0, 150.0); INSERT INTO t1 VALUES(9223372036854775807, 150, 150, 400, 400); SELECT rtreenode(2, data) FROM t1_node; } } {{{1073741824 0 0 100 100} {2147483646 0 0 200 200} {4294967296 0 0 300 300} {8589934592 20 20 150 150} {9223372036854775807 150 150 400 400}}} } else { |
Changes to ext/rtree/sqlite3rtree.h.
︙ | |||
27 28 29 30 31 32 33 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | + + + - + + | ** R-Tree geometry query as follows: ** ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...) */ int sqlite3_rtree_geometry_callback( sqlite3 *db, const char *zGeom, #ifdef SQLITE_RTREE_INT_ONLY int (*xGeom)(sqlite3_rtree_geometry*, int n, sqlite3_int64 *a, int *pRes), #else |
︙ |
Changes to src/btree.c.
︙ | |||
7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 | 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 | + + + + + + + + + + + + + + + + + + + - + + - + | if( pCheck->errMsg.mallocFailed ){ pCheck->mallocFailed = 1; } } #endif /* SQLITE_OMIT_INTEGRITY_CHECK */ #ifndef SQLITE_OMIT_INTEGRITY_CHECK /* ** Return non-zero if the bit in the IntegrityCk.aPgRef[] array that ** corresponds to page iPg is already set. */ static int getPageReferenced(IntegrityCk *pCheck, Pgno iPg){ assert( iPg<=pCheck->nPage && sizeof(pCheck->aPgRef[0])==1 ); return (pCheck->aPgRef[iPg/8] & (1 << (iPg & 0x07))); } /* ** Set the bit in the IntegrityCk.aPgRef[] array that corresponds to page iPg. */ static void setPageReferenced(IntegrityCk *pCheck, Pgno iPg){ assert( iPg<=pCheck->nPage && sizeof(pCheck->aPgRef[0])==1 ); pCheck->aPgRef[iPg/8] |= (1 << (iPg & 0x07)); } /* ** Add 1 to the reference count for page iPage. If this is the second ** reference to the page, add an error message to pCheck->zErrMsg. ** Return 1 if there are 2 ore more references to the page and 0 if ** if this is the first reference to the page. ** ** Also check that the page number is in bounds. */ static int checkRef(IntegrityCk *pCheck, Pgno iPage, char *zContext){ if( iPage==0 ) return 1; if( iPage>pCheck->nPage ){ checkAppendMsg(pCheck, zContext, "invalid page number %d", iPage); return 1; } |
︙ | |||
7944 7945 7946 7947 7948 7949 7950 | 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 | - - + + + - - + - - | sCheck.nErr = 0; sCheck.mallocFailed = 0; *pnErr = 0; if( sCheck.nPage==0 ){ sqlite3BtreeLeave(p); return 0; } |
︙ | |||
7979 7980 7981 7982 7983 7984 7985 | 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 | - + - + - + - + | checkTreePage(&sCheck, aRoot[i], "List of tree roots: ", NULL, NULL); } /* Make sure every page in the file is referenced */ for(i=1; i<=sCheck.nPage && sCheck.mxErr; i++){ #ifdef SQLITE_OMIT_AUTOVACUUM |
︙ |
Changes to src/btreeInt.h.
︙ | |||
627 628 629 630 631 632 633 634 635 636 637 638 | 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 | + + + + + + - + | #define ISAUTOVACUUM 0 #endif /* ** This structure is passed around through all the sanity checking routines ** in order to keep track of some global state information. ** ** The aRef[] array is allocated so that there is 1 bit for each page in ** the database. As the integrity-check proceeds, for each page used in ** the database the corresponding bit is set. This allows integrity-check to ** detect pages that are used twice and orphaned pages (both of which ** indicate corruption). */ typedef struct IntegrityCk IntegrityCk; struct IntegrityCk { BtShared *pBt; /* The tree being checked out */ Pager *pPager; /* The associated pager. Also accessible by pBt->pPager */ |
︙ |
Changes to src/callback.c.
︙ | |||
218 219 220 221 222 223 224 225 226 227 | 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 | + + + + + + + + - - + + - - + - - - + + - - + - - + + + + + - - - - - + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - + + + + | } /* During the search for the best function definition, this procedure ** is called to test how well the function passed as the first argument ** matches the request for a function with nArg arguments in a system ** that uses encoding enc. The value returned indicates how well the ** request is matched. A higher value indicates a better match. ** ** If nArg is -1 that means to only return a match (non-zero) if p->nArg ** is also -1. In other words, we are searching for a function that ** takes a variable number of arguments. ** ** If nArg is -2 that means that we are searching for any function ** regardless of the number of arguments it uses, so return a positive ** match score for any ** ** The returned value is always between 0 and 6, as follows: ** |
︙ | |||
306 307 308 309 310 311 312 | 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 | - + - - - - - + + + + - + - + + | ** Locate a user function given a name, a number of arguments and a flag ** indicating whether the function prefers UTF-16 over UTF-8. Return a ** pointer to the FuncDef structure that defines that function, or return ** NULL if the function does not exist. ** ** If the createFlag argument is true, then a new (blank) FuncDef ** structure is created and liked into the "db" structure if a |
︙ | |||
377 378 379 380 381 382 383 | 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 | - + | } } /* If the createFlag parameter is true and the search did not reveal an ** exact match for the name, number of arguments and encoding, then add a ** new entry to the hash table and return it. */ |
︙ |
Changes to src/expr.c.
︙ | |||
480 481 482 483 484 485 486 | 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 | + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | Expr *sqlite3PExpr( Parse *pParse, /* Parsing context */ int op, /* Expression opcode */ Expr *pLeft, /* Left operand */ Expr *pRight, /* Right operand */ const Token *pToken /* Argument token */ ){ Expr *p; if( op==TK_AND && pLeft && pRight ){ /* Take advantage of short-circuit false optimization for AND */ p = sqlite3ExprAnd(pParse->db, pLeft, pRight); }else{ |
︙ | |||
3742 3743 3744 3745 3746 3747 3748 | 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 | - + | if( sqlite3ExprCompare(pA->pRight, pB->pRight) ) return 2; if( sqlite3ExprListCompare(pA->x.pList, pB->x.pList) ) return 2; if( pA->iTable!=pB->iTable || pA->iColumn!=pB->iColumn ) return 2; if( ExprHasProperty(pA, EP_IntValue) ){ if( !ExprHasProperty(pB, EP_IntValue) || pA->u.iValue!=pB->u.iValue ){ return 2; } |
︙ | |||
3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 | 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | Expr *pExprA = pA->a[i].pExpr; Expr *pExprB = pB->a[i].pExpr; if( pA->a[i].sortOrder!=pB->a[i].sortOrder ) return 1; if( sqlite3ExprCompare(pExprA, pExprB) ) return 1; } return 0; } /* ** This is the expression callback for sqlite3FunctionUsesOtherSrc(). ** ** Determine if an expression references any table other than one of the ** tables in pWalker->u.pSrcList and abort if it does. */ static int exprUsesOtherSrc(Walker *pWalker, Expr *pExpr){ if( pExpr->op==TK_COLUMN || pExpr->op==TK_AGG_COLUMN ){ int i; SrcList *pSrc = pWalker->u.pSrcList; for(i=0; i<pSrc->nSrc; i++){ if( pExpr->iTable==pSrc->a[i].iCursor ) return WRC_Continue; } return WRC_Abort; }else{ return WRC_Continue; } } /* ** Determine if any of the arguments to the pExpr Function references ** any SrcList other than pSrcList. Return true if they do. Return ** false if pExpr has no argument or has only constant arguments or ** only references tables named in pSrcList. */ static int sqlite3FunctionUsesOtherSrc(Expr *pExpr, SrcList *pSrcList){ Walker w; assert( pExpr->op==TK_AGG_FUNCTION ); memset(&w, 0, sizeof(w)); w.xExprCallback = exprUsesOtherSrc; w.u.pSrcList = pSrcList; if( sqlite3WalkExprList(&w, pExpr->x.pList)!=WRC_Continue ) return 1; return 0; } /* ** Add a new element to the pAggInfo->aCol[] array. Return the index of ** the new element. Return a negative number if malloc fails. */ static int addAggInfoColumn(sqlite3 *db, AggInfo *pInfo){ int i; |
︙ | |||
3894 3895 3896 3897 3898 3899 3900 | 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 | - + - - | break; } /* endif pExpr->iTable==pItem->iCursor */ } /* end loop over pSrcList */ } return WRC_Prune; } case TK_AGG_FUNCTION: { |
︙ | |||
3940 3941 3942 3943 3944 3945 3946 | 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 | - - - - - - - - + - + | return WRC_Prune; } } } return WRC_Continue; } static int analyzeAggregatesInSelect(Walker *pWalker, Select *pSelect){ |
︙ |
Changes to src/insert.c.
︙ | |||
1214 1215 1216 1217 1218 1219 1220 | 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 | - | } /* Test all CHECK constraints */ #ifndef SQLITE_OMIT_CHECK if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){ ExprList *pCheck = pTab->pCheck; |
︙ |
Changes to src/os_unix.c.
︙ | |||
161 162 163 164 165 166 167 | 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | - - + + | ** Default permissions when creating a new file */ #ifndef SQLITE_DEFAULT_FILE_PERMISSIONS # define SQLITE_DEFAULT_FILE_PERMISSIONS 0644 #endif /* |
︙ | |||
508 509 510 511 512 513 514 | 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 | - + - + + + + + + + - + + + + - + | if( aSyscall[i].pCurrent!=0 ) return aSyscall[i].zName; } return 0; } /* ** Invoke open(). Do so multiple times, until it either succeeds or |
︙ | |||
3332 3333 3334 3335 3336 3337 3338 | 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 | - - - | sqlite3_snprintf(MAX_PATHNAME, zDirname, "%s", zFilename); for(ii=(int)strlen(zDirname); ii>1 && zDirname[ii]!='/'; ii--); if( ii>0 ){ zDirname[ii] = '\0'; fd = robust_open(zDirname, O_RDONLY|O_BINARY, 0); if( fd>=0 ){ |
︙ | |||
3417 3418 3419 3420 3421 3422 3423 | 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 | - + | SimulateIOError( return SQLITE_IOERR_TRUNCATE ); /* If the user has configured a chunk-size for this file, truncate the ** file so that it consists of an integer number of chunks (i.e. the ** actual file size after the operation may be larger than the requested ** size). */ |
︙ | |||
5179 5180 5181 5182 5183 5184 5185 | 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 | - - - - | } #if SQLITE_ENABLE_LOCKING_STYLE else{ p->openFlags = openFlags; } #endif |
︙ |
Changes to src/resolve.c.
︙ | |||
529 530 531 532 533 534 535 | 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 | - + | testcase( pExpr->op==TK_CONST_FUNC ); assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); zId = pExpr->u.zToken; nId = sqlite3Strlen30(zId); pDef = sqlite3FindFunction(pParse->db, zId, nId, n, enc, 0); if( pDef==0 ){ |
︙ |
Changes to src/rowset.c.
︙ | |||
72 73 74 75 76 77 78 79 80 81 82 83 84 85 | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | + + + + + | ** The number of rowset entries per allocation chunk. */ #define ROWSET_ENTRY_PER_CHUNK \ ((ROWSET_ALLOCATION_SIZE-8)/sizeof(struct RowSetEntry)) /* ** Each entry in a RowSet is an instance of the following object. ** ** This same object is reused to store a linked list of trees of RowSetEntry ** objects. In that alternative use, pRight points to the next entry ** in the list, pLeft points to the tree, and v is unused. The ** RowSet.pForest value points to the head of this forest list. */ struct RowSetEntry { i64 v; /* ROWID value for this entry */ struct RowSetEntry *pRight; /* Right subtree (larger entries) or list */ struct RowSetEntry *pLeft; /* Left subtree (smaller entries) */ }; |
︙ | |||
101 102 103 104 105 106 107 | 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 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | - + - + + + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + - - - - - - - + + + + + - - + + - - + | */ struct RowSet { struct RowSetChunk *pChunk; /* List of all chunk allocations */ sqlite3 *db; /* The database connection */ struct RowSetEntry *pEntry; /* List of entries using pRight */ struct RowSetEntry *pLast; /* Last entry on the pEntry list */ struct RowSetEntry *pFresh; /* Source of new entry objects */ |
︙ | |||
232 233 234 235 236 237 238 | 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 | - + + - + - + - - - + - - - + + - + - + + - + - + - + - - | assert( pB==0 || pB->pRight==0 || pB->v<=pB->pRight->v ); pTail->pRight = pB; } return head.pRight; } /* |
︙ | |||
351 352 353 354 355 356 357 | 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 | - - - + + + + - - + + + + + + + + + + + + + + + - - - + + + - - - + + + + + + + + + - + + + + + + + - + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + | p->pLeft = pLeft; p->pRight = rowSetNDeepTree(&pList, iDepth); } return p; } /* |
Changes to src/select.c.
︙ | |||
1254 1255 1256 1257 1258 1259 1260 | 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 | + - - - + + + + + + + + + + | int cnt; /* Index added to make the name unique */ Column *aCol, *pCol; /* For looping over result columns */ int nCol; /* Number of columns in the result set */ Expr *p; /* Expression for a single result column */ char *zName; /* Column name */ int nName; /* Size of name in zName[] */ if( pEList ){ |
︙ | |||
2839 2840 2841 2842 2843 2844 2845 | 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 | - + + | } } /***** If we reach this point, flattening is permitted. *****/ /* Authorize the subquery */ pParse->zAuthContext = pSubitem->zName; |
︙ |
Changes to src/shell.c.
︙ | |||
417 418 419 420 421 422 423 424 425 426 427 428 429 430 | 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 | + | */ struct callback_data { sqlite3 *db; /* The database */ int echoOn; /* True to echo input commands */ int statsOn; /* True to display memory stats before each finalize */ int cnt; /* Number of records displayed so far */ FILE *out; /* Write results here */ FILE *traceOut; /* Output for sqlite3_trace() */ int nErr; /* Number of errors seen */ int mode; /* An output mode setting */ int writableSchema; /* True if PRAGMA writable_schema=ON */ int showHeader; /* True to show column names in List or Column mode */ char *zDestTable; /* Name of destination table when MODE_Insert */ char separator[20]; /* Separator character for MODE_List */ int colWidth[100]; /* Requested width of each column when in column mode*/ |
︙ | |||
1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 | 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 | + | zSelect = appendText(zSelect, "SELECT 'INSERT INTO ' || ", 0); /* Always quote the table name, even if it appears to be pure ascii, ** in case it is a keyword. Ex: INSERT INTO "table" ... */ zTmp = appendText(zTmp, zTable, '"'); if( zTmp ){ zSelect = appendText(zSelect, zTmp, '\''); free(zTmp); } zSelect = appendText(zSelect, " || ' VALUES(' || ", 0); rc = sqlite3_step(pTableInfo); while( rc==SQLITE_ROW ){ const char *zText = (const char *)sqlite3_column_text(pTableInfo, 1); zSelect = appendText(zSelect, "quote(", 0); zSelect = appendText(zSelect, zText, '"'); |
︙ | |||
1333 1334 1335 1336 1337 1338 1339 | 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 | - + | zSelect = appendText(zSelect, zTable, '"'); rc = run_table_dump_query(p, zSelect, zPrepStmt); if( rc==SQLITE_CORRUPT ){ zSelect = appendText(zSelect, " ORDER BY rowid DESC", 0); run_table_dump_query(p, zSelect, 0); } |
︙ | |||
1363 1364 1365 1366 1367 1368 1369 | 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 | - + | if( zErr ){ fprintf(p->out, "/****** %s ******/\n", zErr); sqlite3_free(zErr); zErr = 0; } zQ2 = malloc( len+100 ); if( zQ2==0 ) return rc; |
︙ | |||
1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 | 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 | + | ".separator STRING Change separator used by output mode and .import\n" ".show Show the current values for various settings\n" ".stats ON|OFF Turn stats on or off\n" ".tables ?TABLE? List names of tables\n" " If TABLE specified, only list tables matching\n" " LIKE pattern TABLE.\n" ".timeout MS Try opening locked tables for MS milliseconds\n" ".trace FILE|off Output each SQL statement as it is run\n" ".vfsname ?AUX? Print the name of the VFS stack\n" ".width NUM1 NUM2 ... Set column widths for \"column\" mode\n" ; static char zTimerHelp[] = ".timer ON|OFF Turn the CPU timer measurement on or off\n" ; |
︙ | |||
1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 | 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | if( strcmp(zArg,"on")==0 ){ val = 1; }else if( strcmp(zArg,"yes")==0 ){ val = 1; } return val; } /* ** Close an output file, assuming it is not stderr or stdout */ static void output_file_close(FILE *f){ if( f && f!=stdout && f!=stderr ) fclose(f); } /* ** Try to open an output file. The names "stdout" and "stderr" are ** recognized and do the right thing. NULL is returned if the output ** filename is "off". */ static FILE *output_file_open(const char *zFile){ FILE *f; if( strcmp(zFile,"stdout")==0 ){ f = stdout; }else if( strcmp(zFile, "stderr")==0 ){ f = stderr; }else if( strcmp(zFile, "off")==0 ){ f = 0; }else{ f = fopen(zFile, "wb"); if( f==0 ){ fprintf(stderr, "Error: cannot open \"%s\"\n", zFile); } } return f; } /* ** A routine for handling output from sqlite3_trace(). */ static void sql_trace_callback(void *pArg, const char *z){ FILE *f = (FILE*)pArg; if( f ) fprintf(f, "%s\n", z); } /* ** A no-op routine that runs with the ".breakpoint" doc-command. This is ** a useful spot to set a debugger breakpoint. */ static void test_breakpoint(void){ static int nCall = 0; nCall++; } /* ** If an input line begins with "." then invoke this routine to ** process that line. ** ** Return 1 on error, 2 to exit, and 0 otherwise. */ |
︙ | |||
1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 | 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 | + + + + + + + | } sqlite3_close(pDest); }else if( c=='b' && n>=3 && strncmp(azArg[0], "bail", n)==0 && nArg>1 && nArg<3 ){ bail_on_error = booleanValue(azArg[1]); }else /* The undocumented ".breakpoint" command causes a call to the no-op ** routine named test_breakpoint(). */ if( c=='b' && n>=3 && strncmp(azArg[0], "breakpoint", n)==0 ){ test_breakpoint(); }else if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 && nArg==1 ){ struct callback_data data; char *zErrMsg = 0; open_db(p); memcpy(&data, p, sizeof(data)); data.showHeader = 1; |
︙ | |||
1928 1929 1930 1931 1932 1933 1934 | 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 | - - - + + - - - - - - - - - - - - - | rc = 1; } }else #endif if( c=='l' && strncmp(azArg[0], "log", n)==0 && nArg>=2 ){ const char *zFile = azArg[1]; |
︙ | |||
1996 1997 1998 1999 2000 2001 2002 | 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 | - - - - - - + + + + + - - - + - - + - + + - + + - + | if( c=='n' && strncmp(azArg[0], "nullvalue", n)==0 && nArg==2 ) { sqlite3_snprintf(sizeof(p->nullvalue), p->nullvalue, "%.*s", (int)ArraySize(p->nullvalue)-1, azArg[1]); }else if( c=='o' && strncmp(azArg[0], "output", n)==0 && nArg==2 ){ |
︙ | |||
2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 | 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 | + + + + + + + + + + + + | if( HAS_TIMER && c=='t' && n>=5 && strncmp(azArg[0], "timer", n)==0 && nArg==2 ){ enableTimer = booleanValue(azArg[1]); }else if( c=='t' && strncmp(azArg[0], "trace", n)==0 && nArg>1 ){ output_file_close(p->traceOut); p->traceOut = output_file_open(azArg[1]); #ifndef SQLITE_OMIT_TRACE if( p->traceOut==0 ){ sqlite3_trace(p->db, 0, 0); }else{ sqlite3_trace(p->db, sql_trace_callback, p->traceOut); } #endif }else if( c=='v' && strncmp(azArg[0], "version", n)==0 ){ printf("SQLite %s %s\n" /*extra-version-info*/, sqlite3_libversion(), sqlite3_sourceid()); }else if( c=='v' && strncmp(azArg[0], "vfsname", n)==0 ){ const char *zDbName = nArg==2 ? azArg[1] : "main"; |
︙ | |||
2603 2604 2605 2606 2607 2608 2609 | 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 | - + - - - + + - + | } free(zLine); return errCnt; } /* ** Return a pathname which is the user's home directory. A |
︙ | |||
2677 2678 2679 2680 2681 2682 2683 | 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 | - - - - - - - - + - - + - + | struct callback_data *p, /* Configuration data */ const char *sqliterc_override /* Name of config file. NULL to use default */ ){ char *home_dir = NULL; const char *sqliterc = sqliterc_override; char *zBuf = 0; FILE *in = NULL; |
︙ | |||
3047 3048 3049 3050 3051 3052 3053 | 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 | - | #endif rc = process_input(&data, 0); if( zHistory ){ stifle_history(100); write_history(zHistory); free(zHistory); } |
Changes to src/sqlite.h.in.
︙ | |||
1538 1539 1540 1541 1542 1543 1544 | 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 | - + | ** connection is opened. If it is globally disabled, filenames are ** only interpreted as URIs if the SQLITE_OPEN_URI flag is set when the ** database connection is opened. By default, URI handling is globally ** disabled. The default value may be changed by compiling with the ** [SQLITE_USE_URI] symbol defined. ** ** [[SQLITE_CONFIG_PCACHE]] [[SQLITE_CONFIG_GETPCACHE]] |
︙ |
Changes to src/sqliteInt.h.
︙ | |||
2015 2016 2017 2018 2019 2020 2021 | 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 | - | SrcList *pSrcList; /* One or more tables used to resolve names */ ExprList *pEList; /* Optional list of named expressions */ int nRef; /* Number of names resolved by this context */ int nErr; /* Number of errors encountered while resolving names */ u8 allowAgg; /* Aggregate functions allowed here */ u8 hasAgg; /* True if aggregates are seen */ u8 isCheck; /* True if resolving names in a CHECK constraint */ |
︙ | |||
2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 | 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 | + | struct Walker { int (*xExprCallback)(Walker*, Expr*); /* Callback for expressions */ int (*xSelectCallback)(Walker*,Select*); /* Callback for SELECTs */ Parse *pParse; /* Parser context. */ union { /* Extra data for callback */ NameContext *pNC; /* Naming context */ int i; /* Integer value */ SrcList *pSrcList; /* FROM clause */ } u; }; /* Forward declarations */ int sqlite3WalkExpr(Walker*, Expr*); int sqlite3WalkExprList(Walker*, ExprList*); int sqlite3WalkSelect(Walker*, Select*); |
︙ | |||
2853 2854 2855 2856 2857 2858 2859 | 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 | - + | void sqlite3HaltConstraint(Parse*, int, char*, int); Expr *sqlite3ExprDup(sqlite3*,Expr*,int); ExprList *sqlite3ExprListDup(sqlite3*,ExprList*,int); SrcList *sqlite3SrcListDup(sqlite3*,SrcList*,int); IdList *sqlite3IdListDup(sqlite3*,IdList*); Select *sqlite3SelectDup(sqlite3*,Select*,int); void sqlite3FuncDefInsert(FuncDefHash*, FuncDef*); |
︙ |
Changes to src/test_config.c.
︙ | |||
421 422 423 424 425 426 427 428 429 430 431 432 433 434 | 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 | + + + + + + | #endif #ifdef SQLITE_ENABLE_RTREE Tcl_SetVar2(interp, "sqlite_options", "rtree", "1", TCL_GLOBAL_ONLY); #else Tcl_SetVar2(interp, "sqlite_options", "rtree", "0", TCL_GLOBAL_ONLY); #endif #ifdef SQLITE_RTREE_INT_ONLY Tcl_SetVar2(interp, "sqlite_options", "rtree_int_only", "1", TCL_GLOBAL_ONLY); #else Tcl_SetVar2(interp, "sqlite_options", "rtree_int_only", "0", TCL_GLOBAL_ONLY); #endif #ifdef SQLITE_OMIT_SCHEMA_PRAGMAS Tcl_SetVar2(interp, "sqlite_options", "schema_pragmas", "0", TCL_GLOBAL_ONLY); #else Tcl_SetVar2(interp, "sqlite_options", "schema_pragmas", "1", TCL_GLOBAL_ONLY); #endif |
︙ |
Changes to src/test_fuzzer.c.
︙ | |||
1123 1124 1125 1126 1127 1128 1129 | 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 | - + - | } pIdxInfo->estimatedCost = (double)10000; return SQLITE_OK; } /* |
︙ |
Changes to src/test_multiplex.c.
︙ | |||
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 | 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 | + - + + + + + + + + + | #ifdef SQLITE_ENABLE_8_3_NAMES /* If JOURNAL_8_3_OFFSET is set to (say) 400, then any overflow files are ** part of a database journal are named db.401, db.402, and so on. A ** database may therefore not grow to larger than 400 chunks. Attempting ** to open chunk 401 indicates the database is full. */ if( iChunk>=SQLITE_MULTIPLEX_JOURNAL_8_3_OFFSET ){ sqlite3_log(SQLITE_FULL, "multiplexed chunk overflow: %s", pGroup->zName); *rc = SQLITE_FULL; return 0; } #endif *rc = multiplexSubFilename(pGroup, iChunk); if( (*rc)==SQLITE_OK && (pSubOpen = pGroup->aReal[iChunk].p)==0 ){ int flags, bExists; flags = pGroup->flags; if( createFlag ){ flags |= SQLITE_OPEN_CREATE; }else if( iChunk==0 ){ /* Fall through */ }else if( pGroup->aReal[iChunk].z==0 ){ return 0; }else{ *rc = pOrigVfs->xAccess(pOrigVfs, pGroup->aReal[iChunk].z, SQLITE_ACCESS_EXISTS, &bExists); |
︙ |
Changes to src/test_quota.c.
︙ | |||
116 117 118 119 120 121 122 123 124 125 126 127 128 129 | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | + + + | ** open file. This object is opaque to all users - the internal ** structure is only visible to the functions below. */ struct quota_FILE { FILE *f; /* Open stdio file pointer */ sqlite3_int64 iOfst; /* Current offset into the file */ quotaFile *pFile; /* The file record in the quota system */ #if SQLITE_OS_WIN char *zMbcsName; /* Full MBCS pathname of the file */ #endif }; /************************* Global Variables **********************************/ /* ** All global variables used by this file are containing within the following ** gQuota structure. |
︙ | |||
975 976 977 978 979 980 981 | 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 | - + - + + + + | /* ** Open a potentially quotaed file for I/O. */ quota_FILE *sqlite3_quota_fopen(const char *zFilename, const char *zMode){ quota_FILE *p = 0; char *zFull = 0; |
︙ | |||
1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 | 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 | + | size_t nmemb, /* Number of elements */ quota_FILE *p /* Write to this quota_FILE objecct */ ){ sqlite3_int64 iOfst; sqlite3_int64 iEnd; sqlite3_int64 szNew; quotaFile *pFile; size_t rc; iOfst = ftell(p->f); iEnd = iOfst + size*nmemb; pFile = p->pFile; if( pFile && pFile->iSize<iEnd ){ quotaGroup *pGroup = pFile->pGroup; quotaEnter(); |
︙ | |||
1064 1065 1066 1067 1068 1069 1070 1071 | 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 | + + - + + + + + + + + + + + + + + | iEnd = iOfst + size*nmemb; szNew = pGroup->iSize - pFile->iSize + iEnd; } } pGroup->iSize = szNew; pFile->iSize = iEnd; quotaLeave(); }else{ pFile = 0; } |
︙ | |||
1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 | 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 | + + + | gQuota.pOrigVfs->xDelete(gQuota.pOrigVfs, pFile->zFilename, 0); quotaRemoveFile(pFile); } quotaGroupDeref(pGroup); } quotaLeave(); } #if SQLITE_OS_WIN quota_mbcs_free(p->zMbcsName); #endif sqlite3_free(p); return rc; } /* ** Flush memory buffers for a quota_FILE to disk. */ |
︙ | |||
1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 | 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | /* ** Tell the current location of a quota_FILE stream. */ long sqlite3_quota_ftell(quota_FILE *p){ return ftell(p->f); } /* ** Truncate a file to szNew bytes. */ int sqlite3_quota_ftruncate(quota_FILE *p, sqlite3_int64 szNew){ quotaFile *pFile = p->pFile; int rc; if( (pFile = p->pFile)!=0 && pFile->iSize<szNew ){ quotaGroup *pGroup; if( pFile->iSize<szNew ){ /* This routine cannot be used to extend a file that is under ** quota management. Only true truncation is allowed. */ return -1; } pGroup = pFile->pGroup; quotaEnter(); pGroup->iSize += szNew - pFile->iSize; quotaLeave(); } #if SQLITE_OS_UNIX rc = ftruncate(fileno(p->f), szNew); #endif #if SQLITE_OS_WIN rc = _chsize_s(_fileno(p->f), szNew); #endif if( pFile && rc==0 ){ quotaGroup *pGroup = pFile->pGroup; quotaEnter(); pGroup->iSize += szNew - pFile->iSize; pFile->iSize = szNew; quotaLeave(); } return rc; } /* ** Determine the time that the given file was last modified, in ** seconds size 1970. Write the result into *pTime. Return 0 on ** success and non-zero on any kind of error. */ int sqlite3_quota_file_mtime(quota_FILE *p, time_t *pTime){ int rc; #if SQLITE_OS_UNIX struct stat buf; rc = fstat(fileno(p->f), &buf); #endif #if SQLITE_OS_WIN struct _stati64 buf; rc = _stati64(p->zMbcsName, &buf); #endif if( rc==0 ) *pTime = buf.st_mtime; return rc; } /* ** Return the true size of the file, as reported by the operating ** system. */ sqlite3_int64 sqlite3_quota_file_truesize(quota_FILE *p){ int rc; #if SQLITE_OS_UNIX struct stat buf; rc = fstat(fileno(p->f), &buf); #endif #if SQLITE_OS_WIN struct _stati64 buf; rc = _stati64(p->zMbcsName, &buf); #endif return rc==0 ? buf.st_size : -1; } /* ** Return the size of the file, as it is known to the quota subsystem. */ sqlite3_int64 sqlite3_quota_file_size(quota_FILE *p){ return p->pFile ? p->pFile->iSize : -1; } /* ** Remove a managed file. Update quotas accordingly. */ int sqlite3_quota_remove(const char *zFilename){ char *zFull; /* Full pathname for zFilename */ int nFull; /* Number of bytes in zFilename */ |
︙ | |||
1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 | 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | return TCL_ERROR; } p = sqlite3TestTextToPtr(Tcl_GetString(objv[1])); x = sqlite3_quota_ftell(p); Tcl_SetObjResult(interp, Tcl_NewWideIntObj(x)); return TCL_OK; } /* ** tclcmd: sqlite3_quota_ftruncate HANDLE SIZE */ static int test_quota_ftruncate( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ quota_FILE *p; sqlite3_int64 x; Tcl_WideInt w; int rc; if( objc!=3 ){ Tcl_WrongNumArgs(interp, 1, objv, "HANDLE SIZE"); return TCL_ERROR; } p = sqlite3TestTextToPtr(Tcl_GetString(objv[1])); if( Tcl_GetWideIntFromObj(interp, objv[2], &w) ) return TCL_ERROR; x = (sqlite3_int64)w; rc = sqlite3_quota_ftruncate(p, x); Tcl_SetObjResult(interp, Tcl_NewIntObj(rc)); return TCL_OK; } /* ** tclcmd: sqlite3_quota_file_size HANDLE */ static int test_quota_file_size( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ quota_FILE *p; sqlite3_int64 x; if( objc!=2 ){ Tcl_WrongNumArgs(interp, 1, objv, "HANDLE"); return TCL_ERROR; } p = sqlite3TestTextToPtr(Tcl_GetString(objv[1])); x = sqlite3_quota_file_size(p); Tcl_SetObjResult(interp, Tcl_NewWideIntObj(x)); return TCL_OK; } /* ** tclcmd: sqlite3_quota_file_truesize HANDLE */ static int test_quota_file_truesize( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ quota_FILE *p; sqlite3_int64 x; if( objc!=2 ){ Tcl_WrongNumArgs(interp, 1, objv, "HANDLE"); return TCL_ERROR; } p = sqlite3TestTextToPtr(Tcl_GetString(objv[1])); x = sqlite3_quota_file_truesize(p); Tcl_SetObjResult(interp, Tcl_NewWideIntObj(x)); return TCL_OK; } /* ** tclcmd: sqlite3_quota_file_mtime HANDLE */ static int test_quota_file_mtime( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ quota_FILE *p; time_t t; if( objc!=2 ){ Tcl_WrongNumArgs(interp, 1, objv, "HANDLE"); return TCL_ERROR; } p = sqlite3TestTextToPtr(Tcl_GetString(objv[1])); t = 0; sqlite3_quota_file_mtime(p, &t); Tcl_SetObjResult(interp, Tcl_NewWideIntObj(t)); return TCL_OK; } /* ** tclcmd: sqlite3_quota_remove FILENAME */ static int test_quota_remove( void * clientData, Tcl_Interp *interp, |
︙ | |||
1709 1710 1711 1712 1713 1714 1715 | 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 | - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + | ** of this module. */ int Sqlitequota_Init(Tcl_Interp *interp){ static struct { char *zName; Tcl_ObjCmdProc *xProc; } aCmd[] = { |
Changes to src/test_quota.h.
︙ | |||
25 26 27 28 29 30 31 32 33 34 35 36 37 38 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | + + + + + + + + | ** callback does enlarge the quota such that the total size of all ** files within the group is less than the new quota, then the write ** continues as if nothing had happened. */ #ifndef _QUOTA_H_ #include "sqlite3.h" #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #if SQLITE_OS_UNIX # include <unistd.h> #endif #if SQLITE_OS_WIN # include <windows.h> #endif /* Make this callable from C++ */ #ifdef __cplusplus extern "C" { #endif /* |
︙ | |||
178 179 180 181 182 183 184 185 186 187 188 189 190 191 | 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ** Move the read/write pointer for a quota_FILE object. Or tell the ** current location of the read/write pointer. */ int sqlite3_quota_fseek(quota_FILE*, long, int); void sqlite3_quota_rewind(quota_FILE*); long sqlite3_quota_ftell(quota_FILE*); /* ** Truncate a file previously opened by sqlite3_quota_fopen(). Return ** zero on success and non-zero on any kind of failure. ** ** The newSize argument must be less than or equal to the current file size. ** Any attempt to "truncate" a file to a larger size results in ** undefined behavior. */ int sqlite3_quota_ftrunate(quota_FILE*, sqlite3_int64 newSize); /* ** Return the last modification time of the opened file, in seconds ** since 1970. */ int sqlite3_quota_file_mtime(quota_FILE*, time_t *pTime); /* ** Return the size of the file as it is known to the quota system. ** ** This size might be different from the true size of the file on ** disk if some outside process has modified the file without using the ** quota mechanism, or if calls to sqlite3_quota_fwrite() have occurred ** which have increased the file size, but those writes have not yet been ** forced to disk using sqlite3_quota_fflush(). ** ** Return -1 if the file is not participating in quota management. */ sqlite3_int64 sqlite3_quota_file_size(quota_FILE*); /* ** Return the true size of the file. ** ** The true size should be the same as the size of the file as known ** to the quota system, however the sizes might be different if the ** file has been extended or truncated via some outside process or if ** pending writes have not yet been flushed to disk. ** ** Return -1 if the file does not exist or if the size of the file ** cannot be determined for some reason. */ sqlite3_int64 sqlite3_quota_file_truesize(quota_FILE*); /* ** Delete a file from the disk, if that file is under quota management. ** Adjust quotas accordingly. ** ** If zFilename is the name of a directory that matches one of the ** quota glob patterns, then all files under quota management that ** are contained within that directory are deleted. |
︙ |
Changes to src/test_rtree.c.
︙ | |||
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | + + + + | /* ** Implementation of "circle" r-tree geometry callback. */ static int circle_geom( sqlite3_rtree_geometry *p, int nCoord, #ifdef SQLITE_RTREE_INT_ONLY sqlite3_int64 *aCoord, #else double *aCoord, #endif int *pRes ){ int i; /* Iterator variable */ Circle *pCircle; /* Structure defining circular region */ double xmin, xmax; /* X dimensions of box being tested */ double ymin, ymax; /* X dimensions of box being tested */ |
︙ | |||
184 185 186 187 188 189 190 | 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | - + + + + + | ** ** cube(x, y, z, width, height, depth) ** ** The width, height and depth parameters must all be greater than zero. */ static int cube_geom( sqlite3_rtree_geometry *p, |
︙ |
Changes to src/vdbe.c.
︙ | |||
2740 2741 2742 2743 2744 2745 2746 | 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 | + - - + + + | p->rc = rc = SQLITE_BUSY; goto vdbe_return; } db->isTransactionSavepoint = 0; rc = p->rc; }else{ iSavepoint = db->nSavepoint - iSavepoint - 1; if( p1==SAVEPOINT_ROLLBACK ){ |
︙ |
Changes to src/vdbeaux.c.
︙ | |||
1236 1237 1238 1239 1240 1241 1242 | 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 | - + | */ if( pOp->p4type==P4_SUBPROGRAM ){ int nByte = (nSub+1)*sizeof(SubProgram*); int j; for(j=0; j<nSub; j++){ if( apSub[j]==pOp->p4.pProgram ) break; } |
︙ |
Changes to src/vdbemem.c.
︙ | |||
55 56 57 58 59 60 61 | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | - - - - + + + + + + + + | #endif } /* ** Make sure pMem->z points to a writable allocation of at least ** n bytes. ** |
︙ |
Changes to test/capi3.test.
︙ | |||
897 898 899 900 901 902 903 904 905 906 907 908 909 910 | 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 | + + + + + + | } {0 {}} do_test capi3-11.9.3 { sqlite3_get_autocommit $DB } 1 do_test capi3-11.10 { sqlite3_step $STMT } {SQLITE_ERROR} ifcapable !autoreset { # If SQLITE_OMIT_AUTORESET is defined, then the statement must be # reset() before it can be passed to step() again. do_test capi3-11.11a { sqlite3_step $STMT } {SQLITE_MISUSE} do_test capi3-11.11b { sqlite3_reset $STMT } {SQLITE_ABORT} } do_test capi3-11.11 { sqlite3_step $STMT } {SQLITE_ROW} do_test capi3-11.12 { sqlite3_step $STMT sqlite3_step $STMT } {SQLITE_DONE} |
︙ |
Changes to test/capi3c.test.
︙ | |||
852 853 854 855 856 857 858 859 860 861 862 863 864 865 | 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 | + + + + + + | } {0 {}} do_test capi3c-11.9.3 { sqlite3_get_autocommit $DB } 1 do_test capi3c-11.10 { sqlite3_step $STMT } {SQLITE_ABORT} ifcapable !autoreset { # If SQLITE_OMIT_AUTORESET is defined, then the statement must be # reset() before it can be passed to step() again. do_test capi3-11.11a { sqlite3_step $STMT } {SQLITE_MISUSE} do_test capi3-11.11b { sqlite3_reset $STMT } {SQLITE_ABORT} } do_test capi3c-11.11 { sqlite3_step $STMT } {SQLITE_ROW} do_test capi3c-11.12 { sqlite3_step $STMT sqlite3_step $STMT } {SQLITE_DONE} |
︙ |
Changes to test/fts3defer.test.
︙ | |||
485 486 487 488 489 490 491 492 493 | 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | INSERT INTO x2 VALUES('a b c d e f g h i j k l m n o p q r s t u v w x y m'); COMMIT; } do_execsql_test 4.2 { SELECT * FROM x2 WHERE x2 MATCH 'a b c d e f g h i j k l m n o p q r s'; } {{a b c d e f g h i j k l m n o p q r s t u v w x y m}} set tokenizers {1 simple} ifcapable icu { lappend tokenizers 2 {icu en_US} } foreach {tn tokenizer} $tokenizers { do_execsql_test 5.$tn.1 " CREATE VIRTUAL TABLE x3 USING FTS4(a, b, TOKENIZE $tokenizer) " do_execsql_test 5.$tn.2 { BEGIN; INSERT INTO x3 VALUES('b b b b b b b b b b b', 'b b b b b b b b b b b b b'); INSERT INTO x3 SELECT * FROM x3; INSERT INTO x3 SELECT * FROM x3; INSERT INTO x3 SELECT * FROM x3; INSERT INTO x3 SELECT * FROM x3; INSERT INTO x3 SELECT * FROM x3; INSERT INTO x3 SELECT * FROM x3; INSERT INTO x3 SELECT * FROM x3; INSERT INTO x3 SELECT * FROM x3; INSERT INTO x3 SELECT * FROM x3; INSERT INTO x3 SELECT * FROM x3; INSERT INTO x3 SELECT * FROM x3; INSERT INTO x3 SELECT * FROM x3; INSERT INTO x3 SELECT * FROM x3; INSERT INTO x3 SELECT * FROM x3; INSERT INTO x3 SELECT * FROM x3; INSERT INTO x3 SELECT * FROM x3; INSERT INTO x3 VALUES('a b c', NULL); INSERT INTO x3 VALUES('a x c', NULL); COMMIT; SELECT * FROM x3 WHERE x3 MATCH 'a b'; } {{a b c} {}} do_execsql_test 5.$tn.3 { DROP TABLE x3 } } finish_test |
Changes to test/fts4merge3.test.
︙ | |||
15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | + + + + + | set testdir [file dirname $argv0] source $testdir/tester.tcl source $testdir/fts3_common.tcl source $testdir/lock_common.tcl source $testdir/bc_common.tcl set ::testprefix fts4merge3 ifcapable !fts3 { finish_test return } if {"" == [bc_find_binaries backcompat.test]} { finish_test return } db close |
︙ |
Changes to test/in.test.
︙ | |||
254 255 256 257 258 259 260 | 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | - + + + + + + + + + + + + + | } } {} do_test in-7.5 { execsql { SELECT a FROM t1 WHERE a IN (5) AND b NOT IN (); } } {5} |
︙ |
Changes to test/quota2.test.
︙ | |||
72 73 74 75 76 77 78 79 80 81 82 83 84 85 | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | + + + + + + + | do_test quota2-1.1 { set ::h1 [sqlite3_quota_fopen quota2a/xyz.txt w+b] sqlite3_quota_fwrite $::h1 1 7000 $bigtext } {4000} do_test quota2-1.2 { set ::quota } {PWD/quota2a/xyz.txt 4000 7000} do_test quota2-1.2.1 { sqlite3_quota_file_size $::h1 } {4000} do_test quota2-1.2.2 { sqlite3_quota_fflush $::h1 1 sqlite3_quota_file_truesize $::h1 } {4000} do_test quota2-1.3 { sqlite3_quota_rewind $::h1 set ::x [sqlite3_quota_fread $::h1 1001 7] string length $::x } {3003} do_test quota2-1.4 { string match $::x [string range $::bigtext 0 3002] |
︙ | |||
108 109 110 111 112 113 114 115 116 117 | 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 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + | sqlite3_quota_rewind $::h1 sqlite3_quota_ftell $::h1 } {0} do_test quota2-1.11 { standard_path [sqlite3_quota_dump] } {{*/quota2b/* 5000 0} {*/quota2a/* 4000 4000 {PWD/quota2a/xyz.txt 4000 1 0}}} do_test quota2-1.12 { sqlite3_quota_ftruncate $::h1 3500 sqlite3_quota_file_size $::h1 } {3500} do_test quota2-1.13 { sqlite3_quota_file_truesize $::h1 } {3500} do_test quota2-1.14 { standard_path [sqlite3_quota_dump] } {{*/quota2b/* 5000 0} {*/quota2a/* 4000 3500 {PWD/quota2a/xyz.txt 3500 1 0}}} do_test quota2-1.15 { sqlite3_quota_fseek $::h1 0 SEEK_END sqlite3_quota_ftell $::h1 } {3500} do_test quota2-1.16 { sqlite3_quota_fwrite $::h1 1 7000 $bigtext } {500} do_test quota2-1.17 { sqlite3_quota_ftell $::h1 } {4000} do_test quota2-1.18 { sqlite3_quota_file_size $::h1 } {4000} do_test quota2-1.19 { sqlite3_quota_fflush $::h1 1 sqlite3_quota_file_truesize $::h1 } {4000} do_test quota2-1.20 { sqlite3_quota_fclose $::h1 standard_path [sqlite3_quota_dump] } {{*/quota2b/* 5000 0} {*/quota2a/* 4000 4000 {PWD/quota2a/xyz.txt 4000 0 0}}} |
︙ |
Added test/savepoint7.test.