Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch mistake Excluding Merge-Ins
This is equivalent to a diff from 54b8888080 to 80dfcc313e
2025-06-03
| ||
14:19 | Merge latest changes from the wal2 branch into this branch. (Leaf check-in: 93740658c8 user: dan tags: bedrock) | |
14:08 | Merge latest trunk changes into this branch. (Closed-Leaf check-in: 80dfcc313e user: dan tags: mistake) | |
10:49 | Enhance sqlite3_rsync so that it works even if the replica database is initially malformed. (check-in: ea1754f7d8 user: drh tags: trunk) | |
2025-05-29
| ||
14:59 | Update the bedrock branch to version 3.50.0 (check-in: 54b8888080 user: drh tags: bedrock) | |
14:47 | Bring the wal2 branch to to version 3.50.0. (check-in: 9f9f81ca9c user: drh tags: wal2) | |
2025-05-19
| ||
16:58 | Merge the latest trunk enhancements into the bedrock branch through the wal2 intermediary. (check-in: e7d6e993df user: drh tags: bedrock) | |
Changes to Makefile.msc.
︙ | |||
2671 2672 2673 2674 2675 2676 2677 | 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 | - + + + + + + + + | # are up-to-date. # srctree-check: $(TOP)\tool\srctree-check.tcl $(TCLSH_CMD) $(TOP)\tool\srctree-check.tcl # Testing for a release # |
︙ |
Changes to VERSION.
| 1 | - + |
|
Changes to autoconf/Makefile.in.
︙ | |||
220 221 222 223 224 225 226 | 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | - + | # # Flags to link the shell app either directly against sqlite3.c # (ENABLE_STATIC_SHELL==1) or libsqlite3.so (ENABLE_STATIC_SHELL==0). # ENABLE_STATIC_SHELL = @ENABLE_STATIC_SHELL@ sqlite3-shell-link-flags.1 = $(TOP)/sqlite3.c $(LDFLAGS.libsqlite3) |
︙ |
Changes to autoconf/tea/Makefile.in.
︙ | |||
142 143 144 145 146 147 148 | 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 | - + + + + + + | # # tx.src is the list of source or object files to include in the # (single) compiler/linker invocation. This will initially contain any # sources passed to [teaish-src-add], but may also be appended to by # teaish.make. # |
︙ | |||
195 196 197 198 199 200 201 | 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 | - - - + + + + + + + + - + | reconfigure: $(teaish.autoreconfig) $(teaish.makefile): $(teaish__auto.def) $(teaish.makefile.in) \ @AUTODEPS@ @if TEAISH_TESTER_TCL_IN |
︙ | |||
244 245 246 247 248 249 250 | 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 | - + + + + + + - - + + + + + + | # .PHONY: test-pre test-prepre test-core test test-post test-extension test-extension: # this name is reserved for use by teaish.make[.in] @if TEAISH_ENABLE_DLL test-prepre: $(tx.dll) @endif @if TEAISH_TESTER_TCL |
︙ | |||
284 285 286 287 288 289 290 | 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | - + | rm -f config.log config.defines.txt @if TEAISH_MAKEFILE_IN @if TEAISH_MAKEFILE rm -f @TEAISH_MAKEFILE@ @endif @endif @if TEAISH_TESTER_TCL_IN |
︙ | |||
351 352 353 354 355 356 357 358 | 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | + + + + - + - + + | @if [ ! -d "$(install-core.tmdir)" ]; then \ set -x; $(INSTALL) -d "$(install-core.tmdir)"; \ fi $(INSTALL.noexec) "@TEAISH_TM_TCL@" "$(install-core.tmdir)/$(tx.tm.tgt)" @endif install-test: install-core @echo "Post-install test of [package require $(tx.name.pkg) $(tx.version)]..."; \ set xtra=""; \ if [ x != "x$(DESTDIR)" ]; then \ xtra='set ::auto_path [linsert $$::auto_path 0 [file normalize $(DESTDIR)$(TCLLIBDIR)/..]];'; \ fi; \ if echo \ |
︙ | |||
402 403 404 405 406 407 408 | 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 | - + - - + - + - + - - + + - - + + - + - + - + - + - - + + - - + + | # When installing teaish as part of "make dist", we need to run # configure with similar flags to what we last configured with but we # must not pass on any extension-specific flags, as those won't be # recognized when running in --teaish-install mode, causing # the sub-configure to fail. dist.flags = --with-tclsh=$(TCLSH) |
︙ |
Changes to autoconf/tea/README.txt.
︙ | |||
36 37 38 39 40 41 42 43 44 | 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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | + + + + - - - - - - - - - + + + + + + + + + + - + + + + - - + + - - + + - - - - + + - - - - - - - + - - - - - - - + + | In both of the above, replace $(TCLSH) with the full pathname of of the tclsh that you want the SQLite extension to work with. See step-by-step instructions at the links below for more information: https://sqlite.org/src/doc/trunk/doc/compile-for-unix.md https://sqlite.org/src/doc/trunk/doc/compile-for-windows.md And info about the extension's Tcl interface can be found at: https://sqlite.org/tclsqlite.html The whole point of the amalgamation-autoconf tarball (in which this |
Changes to autoconf/tea/_teaish.tester.tcl.in.
︙ | |||
17 18 19 20 21 22 23 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | + - + | @TEAISH_VSATISFIES_CODE@ @endif if {[llength [lindex $::argv 0]] > 0} { load [file normalize [lindex $::argv 0]] [lindex $::argv 1]; # ----^^^^^^^ needed on Haiku when argv 0 is just a filename, else # load cannot find the file. } set ::argv [lassign $argv - -] |
︙ |
Deleted autoconf/tea/doc/sqlite3.n.
| - - - - - - - - - - - - - - - |
|
Changes to autoconf/tea/teaish.tcl.
︙ | |||
63 64 65 66 67 68 69 70 71 72 73 74 75 76 | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | + | -name sqlite -name.pkg sqlite3 -version $version -name.dist $distname -vsatisfies 8.6- -libDir sqlite$version -pragmas $pragmas -src generic/tclsqlite3.c } }} [teaish-get -dir] # # Must return either an empty string or a list in the form accepted by # autosetup's [options] function. # |
︙ | |||
115 116 117 118 119 120 121 | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | - - | # # Gets called by tea-configure-core. Must perform any configuration # work needed for this extension. # proc teaish-configure {} { use teaish/feature |
︙ |
Changes to autosetup/proj.tcl.
︙ | |||
56 57 58 59 60 61 62 | 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 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 146 147 148 149 150 151 152 153 154 155 156 157 | - - - + + + + + - - - + + + - + - - + + - + - + - - + - + - - + | # updating global state via feature tests. # # # $proj__Config is an internal-use-only array for storing whatever generic # internal stuff we need stored. # |
︙ | |||
1661 1662 1663 1664 1665 1666 1667 | 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 | - + | 2 { lappend fileIn {*}$args } default { proj-fatal "Too many arguments: $fileIn $args" } } |
︙ | |||
1699 1700 1701 1702 1703 1704 1705 | 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 | - + + - + | # associated script, if any, it runs the file through # proj-validate-no-unresolved-ats, erroring out if that does. # # -clear: after processing, empty the dot-ins list. This effectively # makes proj-dot-ins-append available for re-use. # proc proj-dot-ins-process {args} { |
︙ | |||
1749 1750 1751 1752 1753 1754 1755 | 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 | - + | # proc proj-validate-no-unresolved-ats {args} { foreach f $args { set lnno 1 set isMake [string match {*[Mm]ake*} $f] foreach line [proj-file-content-list $f] { if {!$isMake || ![string match "#*" [string trimleft $line]]} { |
︙ | |||
1889 1890 1891 1892 1893 1894 1895 | 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 | - + | # # By default it returns the result as string of all -D... flags, # but if passed the -list flag it will return a list of the # individual CFLAGS. # proc proj-define-to-cflag {args} { set rv {} |
︙ | |||
1997 1998 1999 2000 2001 2002 2003 | 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 | - + | # @proj-cache-set ?-key KEY? ?-level 0? value # # Sets a feature-check cache entry with the given key. # # See proj-cache-key for -key's and -level's semantics, noting that # this function adds one to -level for purposes of that call. proc proj-cache-set {args} { |
︙ | |||
2033 2034 2035 2036 2037 2038 2039 | 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 | - + | # If the feature-check cache has a matching entry then this function # assigns its value to tgtVar and returns 1, else it assigns tgtVar to # "" and returns 0. # # See proj-cache-key for $key's and $addLevel's semantics, noting that # this function adds one to $addLevel for purposes of that call. proc proj-cache-check {args} { |
︙ | |||
2066 2067 2068 2069 2070 2071 2072 | 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 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 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 | - + - - + + + + + + + - + - + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + - - + + - + - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - + + + + - - - + + + - - - - - + + + - + + - - - - - - + + + + + + + - + - - + + + + + + - - + - + - - - - + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + - + - - - + + + + + + + + + + + + + - - - + + + - - + + - - + + - + + + + + + + + - - - - + + + + + + + + + + + + + - + - - - + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + | return $arg } } return "" } # |
︙ | |||
2229 2230 2231 2232 2233 2234 2235 | 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 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 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 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 | - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | #parray ::proj__Cache; proj-assert {"" ne [proj-cache-remove]} proj-assert {![proj-cache-check check]} proj-assert {"" eq [proj-cache-remove]} proj-assert {"" eq $check} }} |
Changes to ext/fts3/fts3Int.h.
︙ | |||
209 210 211 212 213 214 215 | 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | - + | #define deliberate_fall_through /* ** Macros needed to provide flexible arrays in a portable way */ #ifndef offsetof |
︙ |
Changes to ext/fts5/fts5Int.h.
︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | + | #include "fts5.h" #include "sqlite3ext.h" SQLITE_EXTENSION_INIT1 #include <string.h> #include <assert.h> #include <stddef.h> #ifndef SQLITE_AMALGAMATION typedef unsigned char u8; typedef unsigned int u32; typedef unsigned short u16; typedef short i16; |
︙ | |||
75 76 77 78 79 80 81 | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | - + | # define EIGHT_BYTE_ALIGNMENT(X) ((((uptr)(X) - (uptr)0)&7)==0) #endif /* ** Macros needed to provide flexible arrays in a portable way */ #ifndef offsetof |
︙ |
Changes to ext/jni/src/org/sqlite/jni/capi/AggregateFunction.java.
︙ | |||
116 117 118 119 120 121 122 | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | - + - + | To be called from the implementation's xStep() method, as well as the xValue() and xInverse() methods of the {@link WindowFunction} subclass, to fetch the current per-call UDF state. On the first call to this method for any given sqlite3_context argument, the context is set to the given initial value. On all other calls, the 2nd argument is ignored. |
Changes to ext/rtree/rtree.c.
︙ | |||
60 61 62 63 64 65 66 67 68 69 70 71 72 73 | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | + + | #include "sqlite3ext.h" SQLITE_EXTENSION_INIT1 #else #include "sqlite3.h" #endif int sqlite3GetToken(const unsigned char*,int*); /* In the SQLite core */ #include <stddef.h> /* ** If building separately, we will need some setup that is normally ** found in sqliteInt.h */ #if !defined(SQLITE_AMALGAMATION) #include "sqlite3rtree.h" typedef sqlite3_int64 i64; |
︙ | |||
91 92 93 94 95 96 97 | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | - + | # define ALWAYS(X) ((X)?1:(assert(0),0)) # define NEVER(X) ((X)?(assert(0),1):0) #else # define ALWAYS(X) (X) # define NEVER(X) (X) #endif #ifndef offsetof |
︙ |
Changes to ext/wasm/GNUmakefile.
︙ | |||
406 407 408 409 410 411 412 | 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 | - + | # # Note that the SQLITE_... build flags used here have NO EFFECT on the # JS/WASM build. They are solely for use with $(bin.c-pp) itself. # # -D... flags which should be included in all invocations should be # appended to $(SQLITE.CALL.C-PP.FILTER.global). bin.c-pp := ./c-pp |
︙ | |||
592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 | 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 | + - - + + + | ######################################################################## # emcc flags for .c/.o/.wasm/.js. emcc.flags := ifeq (1,$(emcc.verbose)) emcc.flags += -v # -v is _very_ loud but also informative about what it's doing endif ######################################################################## # emcc flags for .c/.o. emcc.cflags := emcc.cflags += -std=c99 -fPIC # -------------^^^^^^^^ we need c99 for $(sqlite3-wasm.c), primarily # for variadic macros and snprintf() to implement # sqlite3_wasm_enum_json(). emcc.cflags += -I. -I$(dir.top) ######################################################################## # emcc flags specific to building .js/.wasm files... emcc.jsflags := -fPIC emcc.jsflags += --no-entry emcc.jsflags += -sWASM_BIGINT=$(emcc.WASM_BIGINT) emcc.jsflags += -sMODULARIZE emcc.jsflags += -sDYNAMIC_EXECUTION=0 emcc.jsflags += -sNO_POLYFILL emcc.jsflags += -sEXPORTED_FUNCTIONS=@$(EXPORTED_FUNCTIONS.api) emcc.exportedRuntimeMethods := \ |
︙ |
Changes to ext/wasm/api/sqlite3-wasm.c.
︙ | |||
1153 1154 1155 1156 1157 1158 1159 | 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 | - + | typedef struct { int argvIndex; unsigned char omit; } sqlite3_index_constraint_usage; { /* Validate that the above struct sizeof()s match ** expectations. We could improve upon this by ** checking the offsetof() for each member. */ |
︙ |
Changes to main.mk.
︙ | |||
1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 | 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 | + + + + + + | $(TCLSH_CMD) $(TOP)/test/testrunner.tcl mdevtest $(TSTRNNR_OPTS) mdevtest: srctree-check has_tclsh85 $(TCLSH_CMD) $(TOP)/test/testrunner.tcl mdevtest $(TSTRNNR_OPTS) sdevtest: has_tclsh85 $(TCLSH_CMD) $(TOP)/test/testrunner.tcl sdevtest $(TSTRNNR_OPTS) # Like releasetest, except it omits srctree-check and verify-source so # that it can be used on a modified source tree. # xdevtest: has_tclsh85 $(TCLSH_CMD) $(TOP)/test/testrunner.tcl release $(TSTRNNR_OPTS) # # Validate that various generated files in the source tree # are up-to-date. # srctree-check: $(TOP)/tool/srctree-check.tcl $(TCLSH_CMD) $(TOP)/tool/srctree-check.tcl |
︙ |
Changes to src/btree.c.
︙ | |||
1101 1102 1103 1104 1105 1106 1107 | 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 | - + | UnpackedRecord *pIdxKey; /* Unpacked index key */ if( pKey ){ KeyInfo *pKeyInfo = pCur->pKeyInfo; assert( nKey==(i64)(int)nKey ); pIdxKey = sqlite3VdbeAllocUnpackedRecord(pKeyInfo); if( pIdxKey==0 ) return SQLITE_NOMEM_BKPT; |
︙ | |||
3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 | 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 | + | sqlite3_mutex_free(pBt->mutex); } removed = 1; } sqlite3_mutex_leave(pMainMtx); return removed; #else UNUSED_PARAMETER( pBt ); return 1; #endif } /* ** Make sure pBt->pTmpSpace points to an allocation of ** MX_CELL_SIZE(pBt) bytes with a 4-byte prefix for a left-child |
︙ | |||
3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 | 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 | + + + + + + + | } } if( rc!=SQLITE_OK ){ (void)sqlite3PagerWalWriteLock(pPager, 0); unlockBtreeIfUnused(pBt); } #if defined(SQLITE_ENABLE_SETLK_TIMEOUT) if( rc==SQLITE_BUSY_TIMEOUT ){ /* If a blocking lock timed out, break out of the loop here so that ** the busy-handler is not invoked. */ break; } #endif }while( (rc&0xFF)==SQLITE_BUSY && pBt->inTransaction==TRANS_NONE && btreeInvokeBusyHandler(pBt) ); sqlite3PagerWalDb(pPager, 0); #ifdef SQLITE_ENABLE_SETLK_TIMEOUT if( rc==SQLITE_BUSY_TIMEOUT ) rc = SQLITE_BUSY; #endif |
︙ | |||
11834 11835 11836 11837 11838 11839 11840 11841 11842 11843 11844 11845 11846 11847 | 11842 11843 11844 11845 11846 11847 11848 11849 11850 11851 11852 11853 11854 11855 11856 | + | /* ** Return SQLITE_LOCKED_SHAREDCACHE if another user of the same shared ** btree as the argument handle holds an exclusive lock on the ** sqlite_schema table. Otherwise SQLITE_OK. */ int sqlite3BtreeSchemaLocked(Btree *p){ int rc; UNUSED_PARAMETER(p); /* only used in DEBUG builds */ assert( sqlite3_mutex_held(p->db->mutex) ); sqlite3BtreeEnter(p); rc = querySharedCacheTableLock(p, SCHEMA_ROOT, READ_LOCK); assert( rc==SQLITE_OK || rc==SQLITE_LOCKED_SHAREDCACHE ); sqlite3BtreeLeave(p); return rc; } |
︙ |
Changes to src/dbpage.c.
︙ | |||
223 224 225 226 227 228 229 | 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 | - + - - + + + - + | ** 1 schema=main, pgno=?1 ** 2 schema=?1, full table scan ** 3 schema=?1, pgno=?2 ** ** idxStr is not used */ static int dbpageFilter( |
︙ | |||
271 272 273 274 275 276 277 | 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | - - + + | } if( pCsr->pPage1 ) sqlite3PagerUnrefPageOne(pCsr->pPage1); rc = sqlite3PagerGet(pCsr->pPager, 1, &pCsr->pPage1, 0); return rc; } static int dbpageColumn( |
︙ |
Changes to src/expr.c.
︙ | |||
69 70 71 72 73 74 75 | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | - + + + | assert( pExpr->iColumn < pExpr->iTable ); assert( pExpr->iColumn >= 0 ); assert( pExpr->iTable==pExpr->pLeft->x.pSelect->pEList->nExpr ); return sqlite3ExprAffinity( pExpr->pLeft->x.pSelect->pEList->a[pExpr->iColumn].pExpr ); } |
︙ | |||
262 263 264 265 266 267 268 | 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | - + + + | } break; } if( op==TK_CAST || op==TK_UPLUS ){ p = p->pLeft; continue; } |
︙ |
Changes to src/json.c.
︙ | |||
1281 1282 1283 1284 1285 1286 1287 1288 | 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 | + + - + | szType = a[0]>>4; if( szType<=11 ){ nExtra = 0; }else if( szType==12 ){ nExtra = 1; }else if( szType==13 ){ nExtra = 2; }else if( szType==14 ){ nExtra = 4; }else{ |
︙ |
Changes to src/os_unix.c.
︙ | |||
5185 5186 5187 5188 5189 5190 5191 | 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 | + - - - + + + - - - + | return unixMutexFreeShmlock(pDbFd, ofst, n, flags); } /* Check that, if this to be a blocking lock, no locks that occur later ** in the following list than the lock being obtained are already held: ** ** 1. Recovery lock (ofst==2). |
︙ |
Changes to src/os_win.c.
︙ | |||
2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 | 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 | + + + + | */ if( !ret && GetLastError()==ERROR_IO_PENDING ){ DWORD nDelay = (nMs==0 ? INFINITE : nMs); DWORD res = osWaitForSingleObject(ovlp.hEvent, nDelay); if( res==WAIT_OBJECT_0 ){ ret = TRUE; }else if( res==WAIT_TIMEOUT ){ #if SQLITE_ENABLE_SETLK_TIMEOUT==1 rc = SQLITE_BUSY_TIMEOUT; #else rc = SQLITE_BUSY; #endif }else{ /* Some other error has occurred */ rc = SQLITE_IOERR_LOCK; } /* If it is still pending, cancel the LockFileEx() call. */ osCancelIo(hFile); |
︙ | |||
4529 4530 4531 4532 4533 4534 4535 | 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 | + - - - + + + - - - + | || flags==(SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED) || flags==(SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE) ); assert( n==1 || (flags & SQLITE_SHM_EXCLUSIVE)!=0 ); /* Check that, if this to be a blocking lock, no locks that occur later ** in the following list than the lock being obtained are already held: ** ** 1. Recovery lock (ofst==2). |
︙ |
Changes to src/pager.c.
︙ | |||
699 700 701 702 703 704 705 706 707 708 709 710 711 712 | 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 | + + + | int (*xGet)(Pager*,Pgno,DbPage**,int); /* Routine to fetch a patch */ char *pTmpSpace; /* Pager.pageSize bytes of space for tmp use */ PCache *pPCache; /* Pointer to page cache object */ #ifndef SQLITE_OMIT_WAL Wal *pWal; /* Write-ahead log used by "journal_mode=wal" */ char *zWal; /* File name for write-ahead log */ #endif #ifdef SQLITE_ENABLE_SETLK_TIMEOUT sqlite3 *dbWal; #endif }; /* ** Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains ** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS ** or CACHE_WRITE to sqlite3_db_status(). */ |
︙ | |||
7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 | 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 | + + + + + | ** (e.g. due to malloc() failure), return an error code. */ if( rc==SQLITE_OK ){ rc = sqlite3WalOpen(pPager->pVfs, pPager->fd, pPager->zWal, pPager->exclusiveMode, pPager->journalSizeLimit, bWal2, &pPager->pWal ); #ifdef SQLITE_ENABLE_SETLK_TIMEOUT if( rc==SQLITE_OK ){ sqlite3WalDb(pPager->pWal, pPager->dbWal); } #endif } pagerFixMaplimit(pPager); return rc; } |
︙ | |||
7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 | 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 | + | } /* ** Set the database handle used by the wal layer to determine if ** blocking locks are required. */ void sqlite3PagerWalDb(Pager *pPager, sqlite3 *db){ pPager->dbWal = db; if( pagerUseWal(pPager) ){ sqlite3WalDb(pPager->pWal, db); } } #endif #ifdef SQLITE_ENABLE_SNAPSHOT |
︙ |
Changes to src/select.c.
︙ | |||
592 593 594 595 596 597 598 | 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 | - + + + + + - + + + + + | ){ sqlite3ErrorMsg(pParse, "cannot join using column %s - column " "not present in both tables", zName); return 1; } pE1 = sqlite3CreateColumnExpr(db, pSrc, iLeft, iLeftCol); sqlite3SrcItemColumnUsed(&pSrc->a[iLeft], iLeftCol); |
︙ | |||
2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 | 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 | + + + + | sqlite3VdbeSetColName(v, i, COLNAME_TABLE, zOrigTab, SQLITE_TRANSIENT); sqlite3VdbeSetColName(v, i, COLNAME_COLUMN, zOrigCol, SQLITE_TRANSIENT); #else zType = columnType(&sNC, p, 0, 0, 0); #endif sqlite3VdbeSetColName(v, i, COLNAME_DECLTYPE, zType, SQLITE_TRANSIENT); } #else UNUSED_PARAMETER(pParse); UNUSED_PARAMETER(pTabList); UNUSED_PARAMETER(pEList); #endif /* !defined(SQLITE_OMIT_DECLTYPE) */ } /* ** Compute the column names for a SELECT statement. ** |
︙ | |||
4232 4233 4234 4235 4236 4237 4238 | 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 | - - - + + + | ** (2a) the outer query must not be a join and ** (2b) the outer query must not use subqueries ** other than the one FROM-clause subquery that is a candidate ** for flattening. (This is due to ticket [2f7170d73bf9abf80] ** from 2015-02-09.) ** ** (3) If the subquery is the right operand of a LEFT JOIN then |
︙ | |||
4450 4451 4452 4453 4454 4455 4456 | 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 | - + | ** ** which is not at all the same thing. ** ** See also tickets #306, #350, and #3300. */ if( (pSubitem->fg.jointype & (JT_OUTER|JT_LTORJ))!=0 ){ if( pSubSrc->nSrc>1 /* (3a) */ |
︙ |
Changes to src/shell.c.in.
︙ | |||
883 884 885 886 887 888 889 | 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 910 911 | - + + - + + + + + + + + + | const char *z2 = z; while( *z2 ){ z2++; } return 0x3fffffff & (int)(z2 - z); } /* ** Return the length of a string in characters. Multibyte UTF8 characters |
︙ |
Changes to src/sqliteInt.h.
︙ | |||
761 762 763 764 765 766 767 | 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 | - + | #endif /* ** GCC does not define the offsetof() macro so we'll have to do it ** ourselves. */ #ifndef offsetof |
︙ | |||
2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 | 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 | + | #define SQLITE_AFF_NONE 0x40 /* '@' */ #define SQLITE_AFF_BLOB 0x41 /* 'A' */ #define SQLITE_AFF_TEXT 0x42 /* 'B' */ #define SQLITE_AFF_NUMERIC 0x43 /* 'C' */ #define SQLITE_AFF_INTEGER 0x44 /* 'D' */ #define SQLITE_AFF_REAL 0x45 /* 'E' */ #define SQLITE_AFF_FLEXNUM 0x46 /* 'F' */ #define SQLITE_AFF_DEFER 0x58 /* 'X' - defer computation until later */ #define sqlite3IsNumericAffinity(X) ((X)>=SQLITE_AFF_NUMERIC) /* ** The SQLITE_AFF_MASK values masks off the significant bits of an ** affinity value. */ |
︙ | |||
2668 2669 2670 2671 2672 2673 2674 | 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 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 | - - - + + + + + + + + + - + + + + + + + + + + - - + + - - + - - + + | /* ** An instance of the following structure is passed as the first ** argument to sqlite3VdbeKeyCompare and is used to control the ** comparison of the two index keys. ** |
︙ |
Changes to src/tclsqlite.c.
︙ | |||
45 46 47 48 49 50 51 52 53 54 55 56 57 58 | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | + + + + | # endif #endif /* Compatability between Tcl8.6 and Tcl9.0 */ #if TCL_MAJOR_VERSION==9 # define CONST const #elif !defined(Tcl_Size) typedef int Tcl_Size; # ifndef Tcl_BounceRefCount # define Tcl_BounceRefCount(X) Tcl_IncrRefCount(X); Tcl_DecrRefCount(X) /* https://www.tcl-lang.org/man/tcl9.0/TclLib/Object.html */ # endif #endif /**** End copy of tclsqlite.h ****/ #include <errno.h> /* ** Some additional include files are needed if this file is not |
︙ | |||
1080 1081 1082 1083 1084 1085 1086 | 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 | + + - + - + | ** happening, make sure pCmd has a valid string representation */ Tcl_GetString(pCmd); } rc = Tcl_EvalObjEx(p->interp, pCmd, TCL_EVAL_DIRECT); Tcl_DecrRefCount(pCmd); } if( TCL_BREAK==rc ){ sqlite3_result_null(context); |
︙ | |||
1612 1613 1614 1615 1616 1617 1618 | 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 | - + + - + - + - + - - - + + + | struct DbEvalContext { SqliteDb *pDb; /* Database handle */ Tcl_Obj *pSql; /* Object holding string zSql */ const char *zSql; /* Remaining SQL to execute */ SqlPreparedStmt *pPreStmt; /* Current statement */ int nCol; /* Number of columns returned by pStmt */ int evalFlags; /* Flags used */ |
︙ | |||
1683 1684 1685 1686 1687 1688 1689 | 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 | - + - - + + - + + + + + + + + + - - + + + + + + + + + | if( 0==p->apColName ){ sqlite3_stmt *pStmt = p->pPreStmt->pStmt; int i; /* Iterator variable */ int nCol; /* Number of columns returned by pStmt */ Tcl_Obj **apColName = 0; /* Array of column names */ p->nCol = nCol = sqlite3_column_count(pStmt); |
︙ | |||
1747 1748 1749 1750 1751 1752 1753 | 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 | - + | SqlPreparedStmt *pPreStmt = p->pPreStmt; sqlite3_stmt *pStmt = pPreStmt->pStmt; rcs = sqlite3_step(pStmt); if( rcs==SQLITE_ROW ){ return TCL_OK; } |
︙ | |||
1798 1799 1800 1801 1802 1803 1804 | 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 | - - - + + + | */ static void dbEvalFinalize(DbEvalContext *p){ if( p->pPreStmt ){ sqlite3_reset(p->pPreStmt->pStmt); dbReleaseStmt(p->pDb, p->pPreStmt, 0); p->pPreStmt = 0; } |
︙ | |||
1875 1876 1877 1878 1879 1880 1881 | 1897 1898 1899 1900 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 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 | - + - - + + - + - + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | # define Tcl_NREvalObj(a,b,c) 0 # define Tcl_NRCreateCommand(a,b,c,d,e,f) (void)0 #endif /* ** This function is part of the implementation of the command: ** |
︙ | |||
2015 2016 2017 2018 2019 2020 2021 | 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 | - + | "interrupt", "last_insert_rowid", "nullvalue", "onecolumn", "preupdate", "profile", "progress", "rekey", "restore", "rollback_hook", "serialize", "status", "timeout", "total_changes", "trace", "trace_v2", "transaction", "unlock_notify", "update_hook", "version", "wal_hook", |
︙ | |||
2849 2850 2851 2852 2853 2854 2855 | 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 | - + - - - - - + + + + + + + - - + + + - - + + | if( rc==TCL_BREAK ){ rc = TCL_OK; } break; } /* |
︙ | |||
2899 2900 2901 2902 2903 2904 2905 | 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 | - + - + - + | Tcl_SetObjResult(interp, pRet); rc = TCL_OK; } Tcl_DecrRefCount(pRet); }else{ ClientData cd2[2]; DbEvalContext *p; |
︙ |
Changes to src/test1.c.
︙ | |||
8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 | 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 | + + + + + | { "RESET_DB", SQLITE_DBCONFIG_RESET_DATABASE }, { "DEFENSIVE", SQLITE_DBCONFIG_DEFENSIVE }, { "WRITABLE_SCHEMA", SQLITE_DBCONFIG_WRITABLE_SCHEMA }, { "LEGACY_ALTER_TABLE", SQLITE_DBCONFIG_LEGACY_ALTER_TABLE }, { "DQS_DML", SQLITE_DBCONFIG_DQS_DML }, { "DQS_DDL", SQLITE_DBCONFIG_DQS_DDL }, { "LEGACY_FILE_FORMAT", SQLITE_DBCONFIG_LEGACY_FILE_FORMAT }, { "TRUSTED_SCHEMA", SQLITE_DBCONFIG_TRUSTED_SCHEMA }, { "STMT_SCANSTATUS", SQLITE_DBCONFIG_STMT_SCANSTATUS }, { "REVERSE_SCANORDER", SQLITE_DBCONFIG_REVERSE_SCANORDER }, { "ATTACH_CREATE", SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE }, { "ATTACH_WRITE", SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE }, { "COMMENTS", SQLITE_DBCONFIG_ENABLE_COMMENTS }, }; int i; int v = 0; const char *zSetting; sqlite3 *db; if( objc!=4 && objc!=3 ){ |
︙ |
Changes to src/vacuum.c.
︙ | |||
191 192 193 194 195 196 197 | 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | - + + | ** restored before returning. Then set the writable-schema flag, and ** disable CHECK and foreign key constraints. */ saved_flags = db->flags; saved_mDbFlags = db->mDbFlags; saved_nChange = db->nChange; saved_nTotalChange = db->nTotalChange; saved_mTrace = db->mTrace; |
︙ |
Changes to src/vdbe.c.
︙ | |||
2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 | 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 | + | aPermute = pOp[-1].p4.ai + 1; assert( aPermute!=0 ); } n = pOp->p3; pKeyInfo = pOp->p4.pKeyInfo; assert( n>0 ); assert( pKeyInfo!=0 ); assert( pKeyInfo->aSortFlags!=0 ); p1 = pOp->p1; p2 = pOp->p2; #ifdef SQLITE_DEBUG if( aPermute ){ int k, mx = 0; for(k=0; k<n; k++) if( aPermute[k]>(u32)mx ) mx = aPermute[k]; assert( p1>0 && p1+mx<=(p->nMem+1 - p->nCursor)+1 ); |
︙ | |||
5381 5382 5383 5384 5385 5386 5387 | 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 | - + | assert( r.aMem->flags & MEM_Blob ); assert( pOp->opcode!=OP_NoConflict ); rc = ExpandBlob(r.aMem); assert( rc==SQLITE_OK || rc==SQLITE_NOMEM ); if( rc ) goto no_mem; pIdxKey = sqlite3VdbeAllocUnpackedRecord(pC->pKeyInfo); if( pIdxKey==0 ) goto no_mem; |
︙ |
Changes to src/vdbe.h.
︙ | |||
297 298 299 300 301 302 303 | 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | - + | void sqlite3VdbeSetVarmask(Vdbe*, int); #ifndef SQLITE_OMIT_TRACE char *sqlite3VdbeExpandSql(Vdbe*, const char*); #endif int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*); int sqlite3BlobCompare(const Mem*, const Mem*); |
︙ |
Changes to src/vdbeInt.h.
︙ | |||
553 554 555 556 557 558 559 | 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 | - + | i64 iKey1; /* First key value passed to hook */ i64 iKey2; /* Second key value passed to hook */ Mem oldipk; /* Memory cell holding "old" IPK value */ Mem *aNew; /* Array of new.* values */ Table *pTab; /* Schema object being updated */ Index *pPk; /* PK index if pTab is WITHOUT ROWID */ sqlite3_value **apDflt; /* Array of default values, if required */ |
︙ |
Changes to src/vdbeapi.c.
︙ | |||
2159 2160 2161 2162 2163 2164 2165 | 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 | - + | const void *pKey ){ UnpackedRecord *pRet; /* Return value */ pRet = sqlite3VdbeAllocUnpackedRecord(pKeyInfo); if( pRet ){ memset(pRet->aMem, 0, sizeof(Mem)*(pKeyInfo->nKeyField+1)); |
︙ |
Changes to src/vdbeaux.c.
︙ | |||
4219 4220 4221 4222 4223 4224 4225 | 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 | - + - - + - + - - - - - - - + - + - - + | pMem->flags = aFlag[serial_type&1]; return; } } return; } /* |
︙ | |||
4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 | 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 | + + | if( d>(u32)nKey && u ){ assert( CORRUPT_DB ); /* In a corrupt record entry, the last pMem might have been set up using ** uninitialized memory. Overwrite its value with NULL, to prevent ** warnings from MSAN. */ sqlite3VdbeMemSetNull(pMem-1); } testcase( u == pKeyInfo->nKeyField + 1 ); testcase( u < pKeyInfo->nKeyField + 1 ); assert( u<=pKeyInfo->nKeyField + 1 ); p->nField = u; } #ifdef SQLITE_DEBUG /* ** This function compares two index or table record keys in the same way |
︙ | |||
5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 | 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 | + | ** buffer passed to varintRecordCompareInt() this makes it convenient to ** limit the size of the header to 64 bytes in cases where the first field ** is an integer. ** ** The easiest way to enforce this limit is to consider only records with ** 13 fields or less. If the first field is an integer, the maximum legal ** header size is (12*5 + 1 + 1) bytes. */ assert( p->pKeyInfo->aSortFlags!=0 ); if( p->pKeyInfo->nAllField<=13 ){ int flags = p->aMem[0].flags; if( p->pKeyInfo->aSortFlags[0] ){ if( p->pKeyInfo->aSortFlags[0] & KEYINFO_ORDER_BIGNULL ){ return sqlite3VdbeRecordCompare; } p->r1 = 1; |
︙ | |||
5509 5510 5511 5512 5513 5514 5515 | 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 | - | int iReg, /* Register for new.* record */ int iBlobWrite ){ sqlite3 *db = v->db; i64 iKey2; PreUpdate preupdate; const char *zTbl = pTab->zName; |
︙ | |||
5548 5549 5550 5551 5552 5553 5554 | 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 | - + | preupdate.pCsr = pCsr; preupdate.op = op; preupdate.iNewReg = iReg; preupdate.pKeyinfo = (KeyInfo*)&preupdate.keyinfoSpace; preupdate.pKeyinfo->db = db; preupdate.pKeyinfo->enc = ENC(db); preupdate.pKeyinfo->nKeyField = pTab->nCol; |
︙ |
Changes to src/vdbesort.c.
︙ | |||
762 763 764 765 766 767 768 | 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 | - + | SortSubtask *pTask, /* Subtask context (for pKeyInfo) */ int *pbKey2Cached, /* True if pTask->pUnpacked is pKey2 */ const void *pKey1, int nKey1, /* Left side of comparison */ const void *pKey2, int nKey2 /* Right side of comparison */ ){ UnpackedRecord *r2 = pTask->pUnpacked; if( *pbKey2Cached==0 ){ |
︙ | |||
789 790 791 792 793 794 795 | 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 | - + | SortSubtask *pTask, /* Subtask context (for pKeyInfo) */ int *pbKey2Cached, /* True if pTask->pUnpacked is pKey2 */ const void *pKey1, int nKey1, /* Left side of comparison */ const void *pKey2, int nKey2 /* Right side of comparison */ ){ UnpackedRecord *r2 = pTask->pUnpacked; if( !*pbKey2Cached ){ |
︙ | |||
829 830 831 832 833 834 835 836 837 838 839 840 841 842 | 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | + | if( res==0 ){ if( pTask->pSorter->pKeyInfo->nKeyField>1 ){ res = vdbeSorterCompareTail( pTask, pbKey2Cached, pKey1, nKey1, pKey2, nKey2 ); } }else{ assert( pTask->pSorter->pKeyInfo->aSortFlags!=0 ); assert( !(pTask->pSorter->pKeyInfo->aSortFlags[0]&KEYINFO_ORDER_BIGNULL) ); if( pTask->pSorter->pKeyInfo->aSortFlags[0] ){ res = res * -1; } } return res; |
︙ | |||
892 893 894 895 896 897 898 899 900 901 902 903 904 905 | 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 | + | if( res>0 ){ if( *v1 & 0x80 ) res = -1; }else{ if( *v2 & 0x80 ) res = +1; } } assert( pTask->pSorter->pKeyInfo->aSortFlags!=0 ); if( res==0 ){ if( pTask->pSorter->pKeyInfo->nKeyField>1 ){ res = vdbeSorterCompareTail( pTask, pbKey2Cached, pKey1, nKey1, pKey2, nKey2 ); } }else if( pTask->pSorter->pKeyInfo->aSortFlags[0] ){ |
︙ | |||
965 966 967 968 969 970 971 | 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 | + - + + + + + + | #endif assert( pCsr->pKeyInfo ); assert( !pCsr->isEphemeral ); assert( pCsr->eCurType==CURTYPE_SORTER ); assert( sizeof(KeyInfo) + UMXV(pCsr->pKeyInfo->nKeyField)*sizeof(CollSeq*) < 0x7fffffff ); assert( pCsr->pKeyInfo->nKeyField<=pCsr->pKeyInfo->nAllField ); |
︙ | |||
2759 2760 2761 2762 2763 2764 2765 | 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 | - + | r2 = pSorter->pUnpacked = sqlite3VdbeAllocUnpackedRecord(pKeyInfo); if( r2==0 ) return SQLITE_NOMEM_BKPT; r2->nField = nKeyCol; } assert( r2->nField==nKeyCol ); pKey = vdbeSorterRowkey(pSorter, &nKey); |
Changes to src/wal.c.
︙ | |||
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 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 | - + + | if( !useWal ){ assert( rc==SQLITE_OK ); if( pWal->bShmUnreliable==0 ){ rc = walIndexReadHdr(pWal, pChanged); } #ifdef SQLITE_ENABLE_SETLK_TIMEOUT |
︙ |
Changes to src/wherecode.c.
︙ | |||
2197 2198 2199 2200 2201 2202 2203 | 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 | - + + - - + + - + | sqlite3VdbeAddOp4Int(v, OP_NotFound, iCur, addrCont, iRowidReg, pPk->nKeyCol); VdbeCoverage(v); } if( pLevel->iLeftJoin==0 ){ /* If a partial index is driving the loop, try to eliminate WHERE clause ** terms from the query that must be true due to the WHERE clause of |
︙ |
Added test/dblwidth-a.sql.
|
Changes to test/fts3join.test.
︙ | |||
93 94 95 96 97 98 99 | 93 94 95 96 97 98 99 100 101 102 103 104 | - - - - + | do_eqp_test 4.2 { SELECT * FROM t4 LEFT JOIN ( SELECT docid, * FROM ft4 WHERE ft4 MATCH ? ) AS rr ON t4.rowid=rr.docid WHERE t4.y = ?; } { QUERY PLAN |
Changes to test/join.test.
︙ | |||
997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 | 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 | + + + + + + + + + + + + + + + | INSERT INTO t0(c0) VALUES (0); SELECT * FROM t0 LEFT JOIN t1 WHERE NULL IN (c1); } {} do_execsql_test join-20.2 { CREATE INDEX t1x ON t1(0) WHERE NULL IN (c1); SELECT * FROM t0 LEFT JOIN t1 WHERE NULL IN (c1); } {} # 2025-05-29 forum post 7dee41d32506c4ae # The complaint in the forum post appears to be the same as for the # ticket on 2019-11-02, only for RIGHT JOIN instead of LEFT JOIN. Note # that RIGHT JOIN did not yet exist in SQLite when the ticket was # written and fixed. # do_execsql_test join-20.3 { DROP TABLE t1; CREATE TABLE t1(x INT); INSERT INTO t1(x) VALUES(1); CREATE TABLE t2(y BOOLEAN); INSERT INTO t2(y) VALUES(false); CREATE TABLE t3(z INT); INSERT INTO t3(z) VALUES(3); CREATE INDEX t2y ON t2(y) WHERE y; SELECT quote(z) FROM t1 RIGHT JOIN t2 ON y LEFT JOIN t3 ON y; } {NULL} # 2019-11-30 ticket 7f39060a24b47353 # Do not allow a WHERE clause term to qualify a partial index on the # right table of a LEFT JOIN. # do_execsql_test join-21.10 { DROP TABLE t0; |
︙ | |||
1284 1285 1286 1287 1288 1289 1290 1291 1292 | 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | WHERE x <= y; } {} do_execsql_test join-30.3 { SELECT DISTINCT a, b FROM t0 JOIN t1 ON z=a RIGHT JOIN t2 ON a=b LEFT JOIN v5 ON false WHERE x <= y; } {} # 2025-05-30 https://sqlite.org/forum/forumpost/4fc70203b61c7e12 # # When converting a USING(x) or NATURAL into the constraint expression # t1.x==t2.x, mark the t1.x term as EP_CanBeNull if it is the left table # of a RIGHT JOIN. # reset_db db null NULL do_execsql_test join-31.1 { CREATE TABLE t1(c0 INT , c1 INT); INSERT INTO t1(c0, c1) VALUES(NULL,11); CREATE TABLE t2(c0 INT NOT NULL); CREATE TABLE t2n(c0 INT); CREATE TABLE t3(x INT); INSERT INTO t3(x) VALUES(3); CREATE TABLE t4(y INT); INSERT INTO t4(y) VALUES(4); CREATE TABLE t5(c0 INT, x INT); INSERT INTO t5 VALUES(NULL, 5); } do_execsql_test join-31.2 { SELECT * FROM t2 RIGHT JOIN t3 ON true LEFT JOIN t1 USING(c0); } {NULL 3 NULL} do_execsql_test join-31.3 { SELECT * FROM t2 RIGHT JOIN t3 ON true NATURAL LEFT JOIN t1; } {NULL 3 NULL} do_execsql_test join-31.4 { SELECT * FROM t2n RIGHT JOIN t3 ON true LEFT JOIN t1 USING(c0); } {NULL 3 NULL} do_execsql_test join-31.5 { SELECT * FROM t5 LEFT JOIN t1 USING(c0); } {NULL 5 NULL} do_execsql_test join-31.6 { SELECT * FROM t3 LEFT JOIN t2 ON true LEFT JOIN t1 USING(c0); } {3 NULL NULL} do_execsql_test join-31.7 { SELECT * FROM t3 LEFT JOIN t2 ON true NATURAL LEFT JOIN t1; } {3 NULL NULL} do_execsql_test join-31.8 { SELECT * FROM t3 LEFT JOIN t2 ON true JOIN t4 ON true NATURAL LEFT JOIN t1; } {3 NULL 4 NULL} finish_test |
Changes to test/joinH.test.
︙ | |||
336 337 338 339 340 341 342 343 344 | 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 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | SELECT a1.a, sum( a1.a+a1.b ) FROM t3 AS a1 RIGHT JOIN t4 ON a=x GROUP BY a1.a ORDER BY 1; } {NULL NULL 1 -592 4 192 16 48} do_execsql_test 13.4 { SELECT sum( a1.a+a1.b ) FROM t3 AS a1 RIGHT JOIN t3 ON true GROUP BY a1.a ORDER BY 1; } {-1480 240 480} #------------------------------------------------------------------------- # 2025-05-30 # https://sqlite.org/forum/forumpost/5028c785b6 # reset_db do_execsql_test 14.0 { CREATE TABLE t1(c0 INT); CREATE TABLE t2(c0 BLOB); CREATE TABLE t3(c0 BLOB); CREATE TABLE t4(c4 BLOB); INSERT INTO t1(c0) VALUES(0); INSERT INTO t3(c0) VALUES('0'); } do_execsql_test 14.1.1 { SELECT * FROM t1 NATURAL LEFT JOIN t2 NATURAL JOIN t3; } {0} do_execsql_test 14.1.2 { SELECT * FROM t1 NATURAL LEFT JOIN t2 NATURAL JOIN t3 FULL JOIN t4 ON true; } {0 {}} do_execsql_test 14.1.3 { SELECT * FROM (t1 NATURAL LEFT JOIN t2 NATURAL JOIN t3) FULL JOIN t4 ON true; } {0 {}} do_execsql_test 14.1.4 { SELECT * FROM (t1 NATURAL LEFT JOIN t2 NATURAL JOIN t3) AS qq FULL JOIN t4 ON true; } {0 {}} do_execsql_test 14.2.1 { SELECT * FROM t3 NATURAL LEFT JOIN t2 NATURAL JOIN t1; } {0} do_execsql_test 14.2.2 { SELECT * FROM t3 NATURAL LEFT JOIN t2 NATURAL JOIN t1 FULL JOIN t4 ON true; } {0 {}} do_execsql_test 14.2.3 { SELECT * FROM (t3 NATURAL LEFT JOIN t2 NATURAL JOIN t1) FULL JOIN t4 ON true; } {0 {}} do_execsql_test 14.2.4 { SELECT * FROM (t3 NATURAL LEFT JOIN t2 NATURAL JOIN t1) AS qq FULL JOIN t4 ON true; } {0 {}} # 2025-06-01 # reset_db do_execsql_test 15.1 { CREATE TABLE t0(c0); CREATE TABLE t1(c0); CREATE TABLE t2(c0); INSERT INTO t0 VALUES ('1.0'); INSERT INTO t2(c0) VALUES (9); SELECT t0.c0,t2.c0 FROM (SELECT CAST(t0.c0 as REAL) AS c0 FROM t0) as subquery NATURAL LEFT JOIN t1 NATURAL JOIN t0 RIGHT JOIN t2 ON 1; } {1.0 9} do_execsql_test 15.2 { CREATE TABLE x1(x COLLATE nocase); CREATE TABLE x2(x); CREATE TABLE x3(x); CREATE TABLE t4(y); INSERT INTO x1 VALUES('ABC'); INSERT INTO x3 VALUES('abc'); SELECT lower(x), quote(y) FROM x1 LEFT JOIN x2 USING (x) JOIN x3 USING (x) FULL JOIN t4; } {abc NULL} finish_test |
Changes to test/snapshot3.test.
︙ | |||
91 92 93 94 95 96 97 98 99 100 101 102 103 104 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | + + + | file size test.db-wal } 0 do_test 1.8 { execsql BEGIN db3 list [catch { sqlite3_snapshot_open_blob db3 main $snap } msg] $msg } {1 SQLITE_ERROR_SNAPSHOT} db3 close db2 close #------------------------------------------------------------------------- reset_db do_execsql_test 2.0 { PRAGMA journal_mode = wal; CREATE TABLE t1(a, b); INSERT INTO t1 VALUES(1, 2); |
︙ |
Changes to test/tclsqlite.test.
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - + | # 2001 September 15 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for TCL interface to the |
︙ | |||
117 118 119 120 121 122 123 | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | - + | set v [catch {db complete} msg] lappend v $msg } {1 {wrong # args: should be "db complete SQL"}} } do_test tcl-1.14 { set v [catch {db eval} msg] lappend v $msg |
︙ | |||
354 355 356 357 358 359 360 361 362 363 364 365 366 367 | 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 | + + + + + + + + + + + + + | db function ret_dbl {return [expr {rand()*0.5}]} execsql {SELECT typeof(ret_dbl())} } {real} do_test tcl-9.3 { db function ret_int {return [expr {int(rand()*200)}]} execsql {SELECT typeof(ret_int())} } {integer} proc breakAsNullUdf args { if {"1" eq [lindex $args 0]} {return -code break} } do_test tcl-9.4 { db function banu breakAsNullUdf execsql {SELECT typeof(banu()), typeof(banu(1))} } {text null} do_test tcl-9.5 { db nullvalue banunull db eval {SELECT banu(), banu(1)} } {{} banunull} # Recursive calls to the same user-defined function # ifcapable tclvar { do_test tcl-9.10 { proc userfunc_r1 {n} { if {$n<=0} {return 0} |
︙ | |||
461 462 463 464 465 466 467 | 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 | - + - + | } }] } {2} do_test tcl-10.13 { db eval {SELECT * FROM t4} } {1 2 5 6 7} |
︙ | |||
670 671 672 673 674 675 676 | 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 | - + - - - + + + | db exists {SELECT a FROM t1 WHERE a>2} } {1} do_test tcl-15.5 { db exists {SELECT a FROM t1 WHERE a>3} } {0} |
︙ | |||
716 717 718 719 720 721 722 | 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 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 | - + - - - + + + - + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + | #------------------------------------------------------------------------- # Test the -type option to [db function]. # reset_db proc add {a b} { return [expr $a + $b] } proc ret {a} { return $a } |
︙ | |||
844 845 846 847 848 849 850 851 | 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 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 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + + - + - + + | db bind_fallback bind_fallback_does_not_exist } {} do_catchsql_test 19.911 { SELECT $abc, typeof($abc), $def, typeof($def), $ghi, typeof($ghi); } {1 {invalid command name "bind_fallback_does_not_exist"}} db bind_fallback {} # 2025-05-05: the -asdict eval flag # do_test 20.0 { execsql {CREATE TABLE tad(a,b)} execsql {INSERT INTO tad(a,b) VALUES('aa','bb'),('AA','BB')} db eval -asdict { SELECT a, b FROM tad WHERE 0 } D {} set D } {* {a b}} do_test 20.1 { unset D set i 0 set res {} set colNames {} db eval -asdict { SELECT a, b FROM tad ORDER BY a } D { dict set D i [incr i] lappend res $i [dict get $D a] [dict get $D b] if {1 == $i} { set colNames [dict get $D *] } } lappend res $colNames unset D set res } {1 AA BB 2 aa bb {a b}} do_test 20.2 { set res {} db eval -asdict -withoutnulls { SELECT n, a, b FROM ( SELECT 1 as n, 'aa' as a, NULL as b UNION ALL SELECT 2 as n, NULL as a, 'bb' as b ) ORDER BY n } D { dict unset D * lappend res [dict values $D] } unset D execsql {DROP TABLE tad} set res } {{1 aa} {2 bb}} #------------------------------------------------------------------------- |
Changes to test/vacuum.test.
︙ | |||
396 397 398 399 400 401 402 403 404 | 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 | + + + + + + + + + + + + + + + + + + + + + | CREATE TABLE t8(a, b); INSERT INTO t8 VALUES('a', 'b'); INSERT INTO t8 VALUES('c', 'd'); PRAGMA count_changes = 1; } } {} do_test vacuum-10.2 { execsql VACUUM } {} # Verify that VACUUM still works if ATTACH is disabled. # do_execsql_test vacuum-11.1 { PRAGMA page_size=1024; VACUUM; PRAGMA page_size; } {1024} sqlite3_db_config db ATTACH_CREATE 0 do_execsql_test vacuum-11.2 { PRAGMA page_size=2048; VACUUM; PRAGMA page_size; } {2048} sqlite3_db_config db ATTACH_CREATE 1 sqlite3_db_config db ATTACH_WRITE 0 do_execsql_test vacuum-11.3 { PRAGMA page_size=4096; VACUUM; PRAGMA page_size; } {4096} finish_test |
Added test/walsetlk_recover.test.